livekit-plugins-google 1.2.15__py3-none-any.whl → 1.2.17__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/llm.py +4 -0
- livekit/plugins/google/realtime/api_proto.py +1 -0
- livekit/plugins/google/realtime/realtime_api.py +19 -1
- livekit/plugins/google/version.py +1 -1
- {livekit_plugins_google-1.2.15.dist-info → livekit_plugins_google-1.2.17.dist-info}/METADATA +3 -3
- {livekit_plugins_google-1.2.15.dist-info → livekit_plugins_google-1.2.17.dist-info}/RECORD +7 -7
- {livekit_plugins_google-1.2.15.dist-info → livekit_plugins_google-1.2.17.dist-info}/WHEEL +0 -0
livekit/plugins/google/llm.py
CHANGED
|
@@ -136,6 +136,10 @@ class LLM(llm.LLM):
|
|
|
136
136
|
_, gcp_project = default_async( # type: ignore
|
|
137
137
|
scopes=["https://www.googleapis.com/auth/cloud-platform"]
|
|
138
138
|
)
|
|
139
|
+
if not gcp_project or not gcp_location:
|
|
140
|
+
raise ValueError(
|
|
141
|
+
"Project is required for VertexAI via project kwarg or GOOGLE_CLOUD_PROJECT environment variable" # noqa: E501
|
|
142
|
+
)
|
|
139
143
|
gemini_api_key = None # VertexAI does not require an API key
|
|
140
144
|
|
|
141
145
|
else:
|
|
@@ -10,6 +10,7 @@ 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-live-2.5-flash-preview-native-audio-09-2025",
|
|
13
14
|
"gemini-2.5-flash-native-audio-preview-09-2025",
|
|
14
15
|
"gemini-2.5-flash-preview-native-audio-dialog",
|
|
15
16
|
"gemini-2.5-flash-exp-native-audio-thinking-dialog",
|
|
@@ -10,6 +10,7 @@ from collections.abc import Iterator
|
|
|
10
10
|
from dataclasses import dataclass, field
|
|
11
11
|
from typing import Literal
|
|
12
12
|
|
|
13
|
+
from google.auth._default_async import default_async
|
|
13
14
|
from google.genai import Client as GenAIClient, types
|
|
14
15
|
from google.genai.live import AsyncSession
|
|
15
16
|
from livekit import rtc
|
|
@@ -79,6 +80,7 @@ class _RealtimeOptions:
|
|
|
79
80
|
tool_behavior: NotGivenOr[types.Behavior] = NOT_GIVEN
|
|
80
81
|
tool_response_scheduling: NotGivenOr[types.FunctionResponseScheduling] = NOT_GIVEN
|
|
81
82
|
thinking_config: NotGivenOr[types.ThinkingConfig] = NOT_GIVEN
|
|
83
|
+
session_resumption: NotGivenOr[types.SessionResumptionConfig] = NOT_GIVEN
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
@dataclass
|
|
@@ -141,6 +143,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
141
143
|
context_window_compression: NotGivenOr[types.ContextWindowCompressionConfig] = NOT_GIVEN,
|
|
142
144
|
tool_behavior: NotGivenOr[types.Behavior] = NOT_GIVEN,
|
|
143
145
|
tool_response_scheduling: NotGivenOr[types.FunctionResponseScheduling] = NOT_GIVEN,
|
|
146
|
+
session_resumption: NotGivenOr[types.SessionResumptionConfig] = NOT_GIVEN,
|
|
144
147
|
api_version: NotGivenOr[str] = NOT_GIVEN,
|
|
145
148
|
conn_options: APIConnectOptions = DEFAULT_API_CONNECT_OPTIONS,
|
|
146
149
|
http_options: NotGivenOr[types.HttpOptions] = NOT_GIVEN,
|
|
@@ -182,6 +185,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
182
185
|
context_window_compression (ContextWindowCompressionConfig, optional): The configuration for context window compression. Defaults to None.
|
|
183
186
|
tool_behavior (Behavior, optional): The behavior for tool call. Default behavior is BLOCK in Gemini Realtime API.
|
|
184
187
|
tool_response_scheduling (FunctionResponseScheduling, optional): The scheduling for tool response. Default scheduling is WHEN_IDLE.
|
|
188
|
+
session_resumption (SessionResumptionConfig, optional): The configuration for session resumption. Defaults to None.
|
|
185
189
|
thinking_config (ThinkingConfig, optional): Native audio thinking configuration.
|
|
186
190
|
conn_options (APIConnectOptions, optional): The configuration for the API connection. Defaults to DEFAULT_API_CONNECT_OPTIONS.
|
|
187
191
|
_gemini_tools (list[LLMTool], optional): Gemini-specific tools to use for the session. This parameter is experimental and may change.
|
|
@@ -235,6 +239,10 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
235
239
|
)
|
|
236
240
|
|
|
237
241
|
if use_vertexai:
|
|
242
|
+
if not gcp_project:
|
|
243
|
+
_, gcp_project = default_async( # type: ignore
|
|
244
|
+
scopes=["https://www.googleapis.com/auth/cloud-platform"]
|
|
245
|
+
)
|
|
238
246
|
if not gcp_project or not gcp_location:
|
|
239
247
|
raise ValueError(
|
|
240
248
|
"Project is required for VertexAI via project kwarg or GOOGLE_CLOUD_PROJECT environment variable" # noqa: E501
|
|
@@ -278,6 +286,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
278
286
|
conn_options=conn_options,
|
|
279
287
|
http_options=http_options,
|
|
280
288
|
thinking_config=thinking_config,
|
|
289
|
+
session_resumption=session_resumption,
|
|
281
290
|
)
|
|
282
291
|
|
|
283
292
|
self._sessions = weakref.WeakSet[RealtimeSession]()
|
|
@@ -382,7 +391,12 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
382
391
|
self._response_created_futures: dict[str, asyncio.Future[llm.GenerationCreatedEvent]] = {}
|
|
383
392
|
self._pending_generation_fut: asyncio.Future[llm.GenerationCreatedEvent] | None = None
|
|
384
393
|
|
|
385
|
-
self._session_resumption_handle: str | None =
|
|
394
|
+
self._session_resumption_handle: str | None = (
|
|
395
|
+
self._opts.session_resumption.handle
|
|
396
|
+
if is_given(self._opts.session_resumption)
|
|
397
|
+
else None
|
|
398
|
+
)
|
|
399
|
+
|
|
386
400
|
self._in_user_activity = False
|
|
387
401
|
self._session_lock = asyncio.Lock()
|
|
388
402
|
self._num_retries = 0
|
|
@@ -510,6 +524,10 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
510
524
|
return True
|
|
511
525
|
return False
|
|
512
526
|
|
|
527
|
+
@property
|
|
528
|
+
def session_resumption_handle(self) -> str | None:
|
|
529
|
+
return self._session_resumption_handle
|
|
530
|
+
|
|
513
531
|
def push_audio(self, frame: rtc.AudioFrame) -> None:
|
|
514
532
|
for f in self._resample_audio(frame):
|
|
515
533
|
for nf in self._bstream.write(f.data.tobytes()):
|
{livekit_plugins_google-1.2.15.dist-info → livekit_plugins_google-1.2.17.dist-info}/METADATA
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: livekit-plugins-google
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.17
|
|
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/
|
|
7
7
|
Project-URL: Source, https://github.com/livekit/agents
|
|
8
8
|
Author: LiveKit
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
|
-
Keywords: audio,livekit,realtime,video,
|
|
10
|
+
Keywords: ai,audio,gemini,google,livekit,realtime,video,voice
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -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.17
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
28
|
# Google AI plugin for LiveKit Agents
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
livekit/plugins/google/__init__.py,sha256=bYHN04-Ttynj09POAnFP3mln-wrEc1vanUD_YpoWOE4,1434
|
|
2
|
-
livekit/plugins/google/llm.py,sha256=
|
|
2
|
+
livekit/plugins/google/llm.py,sha256=M2v1sUJVVNtmOOJvuWhHsGygQlCJo73pSyrwVxdjzcA,19198
|
|
3
3
|
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
|
4
4
|
livekit/plugins/google/models.py,sha256=jsXHLSCDw-T5dZXeDE2nMT2lr0GooCYO4y4aW7Htps4,2816
|
|
5
5
|
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -7,12 +7,12 @@ livekit/plugins/google/stt.py,sha256=fsWoNnpjgLxqY43cx6GbRI-_QLvXmMvD4WczJFjnoOA
|
|
|
7
7
|
livekit/plugins/google/tools.py,sha256=tD5HVDHO5JfUF029Cx3axHMJec0Gxalkl7s1FDgxLzI,259
|
|
8
8
|
livekit/plugins/google/tts.py,sha256=2Ba4HjAc9RWYL3W4Z2586Ir3bYQGdSH2gfxSR7VsyY4,17454
|
|
9
9
|
livekit/plugins/google/utils.py,sha256=tFByjJ357A1WdCPwBQC4JABR9G5kxX0g7_FuWAIxix4,10002
|
|
10
|
-
livekit/plugins/google/version.py,sha256=
|
|
10
|
+
livekit/plugins/google/version.py,sha256=ZlvvHSEyo4YT35z0OKDbZvGI4D1lVYqTvemcuSdOS8o,601
|
|
11
11
|
livekit/plugins/google/beta/__init__.py,sha256=4q5dx-Y6o9peCDziB03Skf5ngH4PTBsZC86ZawWrgnk,271
|
|
12
12
|
livekit/plugins/google/beta/gemini_tts.py,sha256=SpKorOteQ7GYoGWsxV5YPuGeMexoosmtDXQVz_1ZeLA,8743
|
|
13
13
|
livekit/plugins/google/realtime/__init__.py,sha256=_fW2NMN22F-hnQ4xAJ_g5lPbR7CvM_xXzSWlUQY-E-U,188
|
|
14
|
-
livekit/plugins/google/realtime/api_proto.py,sha256=
|
|
15
|
-
livekit/plugins/google/realtime/realtime_api.py,sha256=
|
|
16
|
-
livekit_plugins_google-1.2.
|
|
17
|
-
livekit_plugins_google-1.2.
|
|
18
|
-
livekit_plugins_google-1.2.
|
|
14
|
+
livekit/plugins/google/realtime/api_proto.py,sha256=h8BMpx0aHcJMDUDeHY_1X9genr6HCsGqe-qZ7hja5MQ,1319
|
|
15
|
+
livekit/plugins/google/realtime/realtime_api.py,sha256=FZN1j8wpNnztES6ANpxb2H2PiUt-eyJQEj0U5qJNgHY,51700
|
|
16
|
+
livekit_plugins_google-1.2.17.dist-info/METADATA,sha256=AmCi3P6499FMeBaYqu020jIHtNEAAs7vnzUTLQ7XVso,1925
|
|
17
|
+
livekit_plugins_google-1.2.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
livekit_plugins_google-1.2.17.dist-info/RECORD,,
|
|
File without changes
|