livekit-plugins-google 0.10.0__py3-none-any.whl → 0.10.1__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.
@@ -307,8 +307,6 @@ class GeminiRealtimeSession(utils.EventEmitter[EventTypes]):
307
307
  self._init_sync_task = asyncio.create_task(asyncio.sleep(0))
308
308
  self._send_ch = utils.aio.Chan[ClientEvents]()
309
309
  self._active_response_id = None
310
- if chat_ctx:
311
- self.generate_reply(chat_ctx)
312
310
 
313
311
  async def aclose(self) -> None:
314
312
  if self._send_ch.closed:
@@ -336,25 +334,6 @@ class GeminiRealtimeSession(utils.EventEmitter[EventTypes]):
336
334
  def _queue_msg(self, msg: ClientEvents) -> None:
337
335
  self._send_ch.send_nowait(msg)
338
336
 
339
- def generate_reply(
340
- self,
341
- ctx: llm.ChatContext | llm.ChatMessage,
342
- turn_complete: bool = True,
343
- ) -> None:
344
- if isinstance(ctx, llm.ChatMessage) and isinstance(ctx.content, str):
345
- new_chat_ctx = llm.ChatContext()
346
- new_chat_ctx.append(text=ctx.content, role=ctx.role)
347
- elif isinstance(ctx, llm.ChatContext):
348
- new_chat_ctx = ctx
349
- else:
350
- raise ValueError("Invalid chat context")
351
- turns, _ = _build_gemini_ctx(new_chat_ctx, id(self))
352
- client_content = LiveClientContent(
353
- turn_complete=turn_complete,
354
- turns=turns,
355
- )
356
- self._queue_msg(client_content)
357
-
358
337
  def chat_ctx_copy(self) -> llm.ChatContext:
359
338
  return self._chat_ctx.copy()
360
339
 
@@ -370,7 +349,16 @@ class GeminiRealtimeSession(utils.EventEmitter[EventTypes]):
370
349
  "cancel_existing", "cancel_new", "keep_both"
371
350
  ] = "keep_both",
372
351
  ) -> None:
373
- raise NotImplementedError("create_response is not supported yet")
352
+ turns, _ = _build_gemini_ctx(self._chat_ctx, id(self))
353
+ ctx = [self._opts.instructions] + turns if self._opts.instructions else turns
354
+
355
+ if not ctx:
356
+ logger.warning(
357
+ "gemini-realtime-session: No chat context to send, sending dummy content."
358
+ )
359
+ ctx = [Content(parts=[Part(text=".")])]
360
+
361
+ self._queue_msg(LiveClientContent(turns=ctx, turn_complete=True))
374
362
 
375
363
  def commit_audio_buffer(self) -> None:
376
364
  raise NotImplementedError("commit_audio_buffer is not supported yet")
@@ -89,9 +89,9 @@ class STT(stt.STT):
89
89
  detect_language: bool = True,
90
90
  interim_results: bool = True,
91
91
  punctuate: bool = True,
92
- spoken_punctuation: bool = True,
93
- model: SpeechModels = "long",
94
- location: str = "global",
92
+ spoken_punctuation: bool = False,
93
+ model: SpeechModels = "chirp_2",
94
+ location: str = "us-central1",
95
95
  sample_rate: int = 16000,
96
96
  credentials_info: dict | None = None,
97
97
  credentials_file: str | None = None,
@@ -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__ = "0.10.0"
15
+ __version__ = "0.10.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: livekit-plugins-google
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Agent Framework plugin for services from Google Cloud
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -4,15 +4,15 @@ livekit/plugins/google/llm.py,sha256=vL8iyRqWVPT0wCDeXTlybytlyJ-J-VolVQYqP-ZVlb0
4
4
  livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
5
5
  livekit/plugins/google/models.py,sha256=w_qmOk5y86vjtszDiGpP9p0ctjQeaB8-UzqprxgpvCY,1407
6
6
  livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- livekit/plugins/google/stt.py,sha256=E5kXPbicH4FEXBjyBzfqQWA-nPhKkojzcc-cbtWdmNs,21088
7
+ livekit/plugins/google/stt.py,sha256=FA6Lpeb8QvRXLzkQ7cjsoMxHdtEGwHWkpN_TKqAdKAQ,21097
8
8
  livekit/plugins/google/tts.py,sha256=95qXCigVQYWNbcN3pIKBpIah4b31U_MWtXv5Ji0AMc4,9229
9
- livekit/plugins/google/version.py,sha256=sAL7xgP18DEksjwYUwabcCgRgKAAGXSWs6xp7NgcxoU,601
9
+ livekit/plugins/google/version.py,sha256=byify7f_Iz8-hX3925GgkmUjX78ckJT4IS6Klbgy6WQ,601
10
10
  livekit/plugins/google/beta/__init__.py,sha256=AxRYc7NGG62Tv1MmcZVCDHNvlhbC86hM-_yP01Qb28k,47
11
11
  livekit/plugins/google/beta/realtime/__init__.py,sha256=sGTn6JFNyA30QUXBZ_BV3l2eHpGAzR35ByXxg77vWNU,205
12
12
  livekit/plugins/google/beta/realtime/api_proto.py,sha256=9EhmwgeIgKDqdSijv5Q9pgx7UhAakK02ZDwbnUsra_o,657
13
- livekit/plugins/google/beta/realtime/realtime_api.py,sha256=vCjDQZvHS749Gf-QOLo-RaW4HlQHlzuArd3IlN5xMmY,21459
13
+ livekit/plugins/google/beta/realtime/realtime_api.py,sha256=579kextvlPbBPV6Zoo3Mkqk0C0UN-Ybfb-gTiR7-f9E,21060
14
14
  livekit/plugins/google/beta/realtime/transcriber.py,sha256=3TaYbtvPWHkxKlDSZSMLWBbR7KewBRg3HcdIxuGhl9c,5880
15
- livekit_plugins_google-0.10.0.dist-info/METADATA,sha256=lsA9pwlWHE-q-9x3HKn2EeJ7ZdcpjxzEtYs1wRH5axE,2057
16
- livekit_plugins_google-0.10.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
17
- livekit_plugins_google-0.10.0.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
18
- livekit_plugins_google-0.10.0.dist-info/RECORD,,
15
+ livekit_plugins_google-0.10.1.dist-info/METADATA,sha256=7XQzkOSP0LocoGcx4TX6VLIUsEvVIvQ1J6wLF7kLocE,2057
16
+ livekit_plugins_google-0.10.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
17
+ livekit_plugins_google-0.10.1.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
18
+ livekit_plugins_google-0.10.1.dist-info/RECORD,,