livekit-plugins-google 1.2.13__py3-none-any.whl → 1.2.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of livekit-plugins-google might be problematic. Click here for more details.
- livekit/plugins/google/__init__.py +2 -2
- livekit/plugins/google/beta/__init__.py +2 -2
- livekit/plugins/google/models.py +1 -0
- livekit/plugins/google/{beta/realtime → realtime}/api_proto.py +33 -1
- livekit/plugins/google/{beta/realtime → realtime}/realtime_api.py +17 -5
- livekit/plugins/google/stt.py +18 -7
- livekit/plugins/google/version.py +1 -1
- {livekit_plugins_google-1.2.13.dist-info → livekit_plugins_google-1.2.15.dist-info}/METADATA +2 -2
- livekit_plugins_google-1.2.15.dist-info/RECORD +18 -0
- livekit_plugins_google-1.2.13.dist-info/RECORD +0 -18
- /livekit/plugins/google/{beta/realtime → realtime}/__init__.py +0 -0
- {livekit_plugins_google-1.2.13.dist-info → livekit_plugins_google-1.2.15.dist-info}/WHEEL +0 -0
|
@@ -19,14 +19,14 @@ Supports Gemini, Cloud Speech-to-Text, and Cloud Text-to-Speech.
|
|
|
19
19
|
See https://docs.livekit.io/agents/integrations/stt/google/ for more information.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
from . import beta
|
|
22
|
+
from . import beta, realtime
|
|
23
23
|
from .llm import LLM
|
|
24
24
|
from .stt import STT, SpeechStream
|
|
25
25
|
from .tools import _LLMTool
|
|
26
26
|
from .tts import TTS
|
|
27
27
|
from .version import __version__
|
|
28
28
|
|
|
29
|
-
__all__ = ["STT", "TTS", "SpeechStream", "__version__", "beta", "LLM", "_LLMTool"]
|
|
29
|
+
__all__ = ["STT", "TTS", "realtime", "SpeechStream", "__version__", "beta", "LLM", "_LLMTool"]
|
|
30
30
|
from livekit.agents import Plugin
|
|
31
31
|
|
|
32
32
|
from .log import logger
|
livekit/plugins/google/models.py
CHANGED
|
@@ -10,11 +10,43 @@ LiveAPIModels = Literal[
|
|
|
10
10
|
# models supported on Gemini API
|
|
11
11
|
"gemini-2.0-flash-live-001",
|
|
12
12
|
"gemini-live-2.5-flash-preview",
|
|
13
|
+
"gemini-2.5-flash-native-audio-preview-09-2025",
|
|
13
14
|
"gemini-2.5-flash-preview-native-audio-dialog",
|
|
14
15
|
"gemini-2.5-flash-exp-native-audio-thinking-dialog",
|
|
15
16
|
]
|
|
16
17
|
|
|
17
|
-
Voice = Literal[
|
|
18
|
+
Voice = Literal[
|
|
19
|
+
"Achernar",
|
|
20
|
+
"Achird",
|
|
21
|
+
"Algenib",
|
|
22
|
+
"Algieba",
|
|
23
|
+
"Alnilam",
|
|
24
|
+
"Aoede",
|
|
25
|
+
"Autonoe",
|
|
26
|
+
"Callirrhoe",
|
|
27
|
+
"Charon",
|
|
28
|
+
"Despina",
|
|
29
|
+
"Enceladus",
|
|
30
|
+
"Erinome",
|
|
31
|
+
"Fenrir",
|
|
32
|
+
"Gacrux",
|
|
33
|
+
"Iapetus",
|
|
34
|
+
"Kore",
|
|
35
|
+
"Laomedeia",
|
|
36
|
+
"Leda",
|
|
37
|
+
"Orus",
|
|
38
|
+
"Pulcherrima",
|
|
39
|
+
"Puck",
|
|
40
|
+
"Rasalgethi",
|
|
41
|
+
"Sadachbia",
|
|
42
|
+
"Sadaltager",
|
|
43
|
+
"Schedar",
|
|
44
|
+
"Sulafat",
|
|
45
|
+
"Umbriel",
|
|
46
|
+
"Vindemiatrix",
|
|
47
|
+
"Zephyr",
|
|
48
|
+
"Zubenelgenubi",
|
|
49
|
+
]
|
|
18
50
|
|
|
19
51
|
|
|
20
52
|
ClientEvents = Union[
|
|
@@ -23,11 +23,11 @@ from livekit.agents.types import (
|
|
|
23
23
|
NotGivenOr,
|
|
24
24
|
)
|
|
25
25
|
from livekit.agents.utils import audio as audio_utils, images, is_given
|
|
26
|
-
from livekit.plugins.google.
|
|
26
|
+
from livekit.plugins.google.realtime.api_proto import ClientEvents, LiveAPIModels, Voice
|
|
27
27
|
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
28
|
+
from ..log import logger
|
|
29
|
+
from ..tools import _LLMTool
|
|
30
|
+
from ..utils import create_tools_config, get_tool_results_for_realtime, to_fnc_ctx
|
|
31
31
|
|
|
32
32
|
INPUT_AUDIO_SAMPLE_RATE = 16000
|
|
33
33
|
INPUT_AUDIO_CHANNELS = 1
|
|
@@ -78,6 +78,7 @@ class _RealtimeOptions:
|
|
|
78
78
|
gemini_tools: NotGivenOr[list[_LLMTool]] = NOT_GIVEN
|
|
79
79
|
tool_behavior: NotGivenOr[types.Behavior] = NOT_GIVEN
|
|
80
80
|
tool_response_scheduling: NotGivenOr[types.FunctionResponseScheduling] = NOT_GIVEN
|
|
81
|
+
thinking_config: NotGivenOr[types.ThinkingConfig] = NOT_GIVEN
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
@dataclass
|
|
@@ -144,6 +145,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
144
145
|
conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
|
|
145
146
|
http_options: NotGivenOr[types.HttpOptions] = NOT_GIVEN,
|
|
146
147
|
_gemini_tools: NotGivenOr[list[_LLMTool]] = NOT_GIVEN,
|
|
148
|
+
thinking_config: NotGivenOr[types.ThinkingConfig] = NOT_GIVEN,
|
|
147
149
|
) -> None:
|
|
148
150
|
"""
|
|
149
151
|
Initializes a RealtimeModel instance for interacting with Google's Realtime API.
|
|
@@ -180,6 +182,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
180
182
|
context_window_compression (ContextWindowCompressionConfig, optional): The configuration for context window compression. Defaults to None.
|
|
181
183
|
tool_behavior (Behavior, optional): The behavior for tool call. Default behavior is BLOCK in Gemini Realtime API.
|
|
182
184
|
tool_response_scheduling (FunctionResponseScheduling, optional): The scheduling for tool response. Default scheduling is WHEN_IDLE.
|
|
185
|
+
thinking_config (ThinkingConfig, optional): Native audio thinking configuration.
|
|
183
186
|
conn_options (APIConnectOptions, optional): The configuration for the API connection. Defaults to DEFAULT_API_CONNECT_OPTIONS.
|
|
184
187
|
_gemini_tools (list[LLMTool], optional): Gemini-specific tools to use for the session. This parameter is experimental and may change.
|
|
185
188
|
|
|
@@ -274,6 +277,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
274
277
|
tool_behavior=tool_behavior,
|
|
275
278
|
conn_options=conn_options,
|
|
276
279
|
http_options=http_options,
|
|
280
|
+
thinking_config=thinking_config,
|
|
277
281
|
)
|
|
278
282
|
|
|
279
283
|
self._sessions = weakref.WeakSet[RealtimeSession]()
|
|
@@ -510,7 +514,12 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
510
514
|
for f in self._resample_audio(frame):
|
|
511
515
|
for nf in self._bstream.write(f.data.tobytes()):
|
|
512
516
|
realtime_input = types.LiveClientRealtimeInput(
|
|
513
|
-
media_chunks=[
|
|
517
|
+
media_chunks=[
|
|
518
|
+
types.Blob(
|
|
519
|
+
data=nf.data.tobytes(),
|
|
520
|
+
mime_type=f"audio/pcm;rate={INPUT_AUDIO_SAMPLE_RATE}",
|
|
521
|
+
)
|
|
522
|
+
]
|
|
514
523
|
)
|
|
515
524
|
self._send_client_event(realtime_input)
|
|
516
525
|
|
|
@@ -814,6 +823,9 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
814
823
|
frequency_penalty=self._opts.frequency_penalty
|
|
815
824
|
if is_given(self._opts.frequency_penalty)
|
|
816
825
|
else None,
|
|
826
|
+
thinking_config=self._opts.thinking_config
|
|
827
|
+
if is_given(self._opts.thinking_config)
|
|
828
|
+
else None,
|
|
817
829
|
),
|
|
818
830
|
system_instruction=types.Content(parts=[types.Part(text=self._opts.instructions)])
|
|
819
831
|
if is_given(self._opts.instructions)
|
livekit/plugins/google/stt.py
CHANGED
|
@@ -618,17 +618,28 @@ def _streaming_recognize_response_to_speech_data(
|
|
|
618
618
|
) -> stt.SpeechData | None:
|
|
619
619
|
text = ""
|
|
620
620
|
confidence = 0.0
|
|
621
|
+
final_result = None
|
|
621
622
|
for result in resp.results:
|
|
622
623
|
if len(result.alternatives) == 0:
|
|
623
624
|
continue
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
625
|
+
else:
|
|
626
|
+
if result.is_final:
|
|
627
|
+
final_result = result
|
|
628
|
+
break
|
|
629
|
+
else:
|
|
630
|
+
text += result.alternatives[0].transcript
|
|
631
|
+
confidence += result.alternatives[0].confidence
|
|
632
|
+
|
|
633
|
+
if final_result is not None:
|
|
634
|
+
text = final_result.alternatives[0].transcript
|
|
635
|
+
confidence = final_result.alternatives[0].confidence
|
|
636
|
+
lg = final_result.language_code
|
|
637
|
+
else:
|
|
638
|
+
confidence /= len(resp.results)
|
|
639
|
+
if confidence < min_confidence_threshold:
|
|
640
|
+
return None
|
|
641
|
+
lg = resp.results[0].language_code
|
|
629
642
|
|
|
630
|
-
if confidence < min_confidence_threshold:
|
|
631
|
-
return None
|
|
632
643
|
if text == "":
|
|
633
644
|
return None
|
|
634
645
|
|
{livekit_plugins_google-1.2.13.dist-info → livekit_plugins_google-1.2.15.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: livekit-plugins-google
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.15
|
|
4
4
|
Summary: Agent Framework plugin for services from Google Cloud
|
|
5
5
|
Project-URL: Documentation, https://docs.livekit.io
|
|
6
6
|
Project-URL: Website, https://livekit.io/
|
|
@@ -22,7 +22,7 @@ Requires-Dist: google-auth<3,>=2
|
|
|
22
22
|
Requires-Dist: google-cloud-speech<3,>=2
|
|
23
23
|
Requires-Dist: google-cloud-texttospeech<3,>=2.27
|
|
24
24
|
Requires-Dist: google-genai>=v1.23.0
|
|
25
|
-
Requires-Dist: livekit-agents>=1.2.
|
|
25
|
+
Requires-Dist: livekit-agents>=1.2.15
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
28
|
# Google AI plugin for LiveKit Agents
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
livekit/plugins/google/__init__.py,sha256=bYHN04-Ttynj09POAnFP3mln-wrEc1vanUD_YpoWOE4,1434
|
|
2
|
+
livekit/plugins/google/llm.py,sha256=u9ZSSkdouPk0018UdiLfgthgTjjLLrXgseX1zrkeg64,18962
|
|
3
|
+
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
|
4
|
+
livekit/plugins/google/models.py,sha256=jsXHLSCDw-T5dZXeDE2nMT2lr0GooCYO4y4aW7Htps4,2816
|
|
5
|
+
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
livekit/plugins/google/stt.py,sha256=fsWoNnpjgLxqY43cx6GbRI-_QLvXmMvD4WczJFjnoOA,26846
|
|
7
|
+
livekit/plugins/google/tools.py,sha256=tD5HVDHO5JfUF029Cx3axHMJec0Gxalkl7s1FDgxLzI,259
|
|
8
|
+
livekit/plugins/google/tts.py,sha256=2Ba4HjAc9RWYL3W4Z2586Ir3bYQGdSH2gfxSR7VsyY4,17454
|
|
9
|
+
livekit/plugins/google/utils.py,sha256=tFByjJ357A1WdCPwBQC4JABR9G5kxX0g7_FuWAIxix4,10002
|
|
10
|
+
livekit/plugins/google/version.py,sha256=R5FvTAJuFKBJlKNE37WH1vS6st7RUEFAUNaLi-rjprE,601
|
|
11
|
+
livekit/plugins/google/beta/__init__.py,sha256=4q5dx-Y6o9peCDziB03Skf5ngH4PTBsZC86ZawWrgnk,271
|
|
12
|
+
livekit/plugins/google/beta/gemini_tts.py,sha256=SpKorOteQ7GYoGWsxV5YPuGeMexoosmtDXQVz_1ZeLA,8743
|
|
13
|
+
livekit/plugins/google/realtime/__init__.py,sha256=_fW2NMN22F-hnQ4xAJ_g5lPbR7CvM_xXzSWlUQY-E-U,188
|
|
14
|
+
livekit/plugins/google/realtime/api_proto.py,sha256=oXKKlf0soMK_MA4LcqP8R5iPgpZvmqjb9KxHJFaBpgk,1261
|
|
15
|
+
livekit/plugins/google/realtime/realtime_api.py,sha256=yex6zADpw-H98cH3jaE1eQ5EVoAss2BTNFDmYebdG8A,50864
|
|
16
|
+
livekit_plugins_google-1.2.15.dist-info/METADATA,sha256=meK7vebwVijpT8F0tFHGwK3uqyK3fIokRR5qSMCrYkk,1909
|
|
17
|
+
livekit_plugins_google-1.2.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
livekit_plugins_google-1.2.15.dist-info/RECORD,,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
livekit/plugins/google/__init__.py,sha256=XIyZ-iFnRBpaLtOJgVwojlB-a8GjdDugVFcjBpMEww8,1412
|
|
2
|
-
livekit/plugins/google/llm.py,sha256=u9ZSSkdouPk0018UdiLfgthgTjjLLrXgseX1zrkeg64,18962
|
|
3
|
-
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
|
4
|
-
livekit/plugins/google/models.py,sha256=poOvUBvgpqmmQV5EUQsq0RgNIRAq7nH-_IZIcIfPSBI,2801
|
|
5
|
-
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
livekit/plugins/google/stt.py,sha256=i99gqXAvYeuhdJ8wh6UlOqLXj6f5_cIni71EwSR4FGw,26467
|
|
7
|
-
livekit/plugins/google/tools.py,sha256=tD5HVDHO5JfUF029Cx3axHMJec0Gxalkl7s1FDgxLzI,259
|
|
8
|
-
livekit/plugins/google/tts.py,sha256=2Ba4HjAc9RWYL3W4Z2586Ir3bYQGdSH2gfxSR7VsyY4,17454
|
|
9
|
-
livekit/plugins/google/utils.py,sha256=tFByjJ357A1WdCPwBQC4JABR9G5kxX0g7_FuWAIxix4,10002
|
|
10
|
-
livekit/plugins/google/version.py,sha256=FpAK0nozieyCPXPHbw0bSGlhnqLEtI6c8pzW0v0EJwI,601
|
|
11
|
-
livekit/plugins/google/beta/__init__.py,sha256=RvAUdvEiRN-fe4JrgPcN0Jkw1kZR9wPerGMFVjS1Cc0,270
|
|
12
|
-
livekit/plugins/google/beta/gemini_tts.py,sha256=SpKorOteQ7GYoGWsxV5YPuGeMexoosmtDXQVz_1ZeLA,8743
|
|
13
|
-
livekit/plugins/google/beta/realtime/__init__.py,sha256=_fW2NMN22F-hnQ4xAJ_g5lPbR7CvM_xXzSWlUQY-E-U,188
|
|
14
|
-
livekit/plugins/google/beta/realtime/api_proto.py,sha256=nb_QkVQDEH7h0SKA9vdS3JaL12a6t2Z1ja4SdnxE6a8,814
|
|
15
|
-
livekit/plugins/google/beta/realtime/realtime_api.py,sha256=bvGLk75j6mO870PYLTZh2W3xY5IxuFkjGevltY2BhQA,50294
|
|
16
|
-
livekit_plugins_google-1.2.13.dist-info/METADATA,sha256=JotfGSQ-D0XSSAQzItPfeQZyvhddyatA3bZI-rLpOqQ,1909
|
|
17
|
-
livekit_plugins_google-1.2.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
-
livekit_plugins_google-1.2.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|