livekit-plugins-google 1.2.15__tar.gz → 1.2.17__tar.gz

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.

Files changed (19) hide show
  1. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/PKG-INFO +3 -3
  2. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/llm.py +4 -0
  3. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/realtime/api_proto.py +1 -0
  4. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/realtime/realtime_api.py +19 -1
  5. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/version.py +1 -1
  6. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/pyproject.toml +2 -2
  7. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/.gitignore +0 -0
  8. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/README.md +0 -0
  9. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/__init__.py +0 -0
  10. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/beta/__init__.py +0 -0
  11. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/beta/gemini_tts.py +0 -0
  12. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/log.py +0 -0
  13. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/models.py +0 -0
  14. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/py.typed +0 -0
  15. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/realtime/__init__.py +0 -0
  16. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/stt.py +0 -0
  17. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/tools.py +0 -0
  18. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/tts.py +0 -0
  19. {livekit_plugins_google-1.2.15 → livekit_plugins_google-1.2.17}/livekit/plugins/google/utils.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-google
3
- Version: 1.2.15
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,webrtc
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.15
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
@@ -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 = 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()):
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.2.15"
15
+ __version__ = "1.2.17"
@@ -10,7 +10,7 @@ readme = "README.md"
10
10
  license = "Apache-2.0"
11
11
  requires-python = ">=3.9.0"
12
12
  authors = [{ name = "LiveKit" }]
13
- keywords = ["webrtc", "realtime", "audio", "video", "livekit"]
13
+ keywords = ["voice", "ai", "realtime", "audio", "video", "livekit", "google", "gemini"]
14
14
  classifiers = [
15
15
  "Intended Audience :: Developers",
16
16
  "License :: OSI Approved :: Apache Software License",
@@ -27,7 +27,7 @@ dependencies = [
27
27
  "google-cloud-speech >= 2, < 3",
28
28
  "google-cloud-texttospeech >= 2.27, < 3",
29
29
  "google-genai >= v1.23.0",
30
- "livekit-agents>=1.2.15",
30
+ "livekit-agents>=1.2.17",
31
31
  ]
32
32
 
33
33
  [project.urls]