livekit-plugins-google 1.2.7__py3-none-any.whl → 1.2.9__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/beta/realtime/realtime_api.py +3 -2
- livekit/plugins/google/llm.py +1 -1
- livekit/plugins/google/tts.py +27 -14
- livekit/plugins/google/version.py +1 -1
- {livekit_plugins_google-1.2.7.dist-info → livekit_plugins_google-1.2.9.dist-info}/METADATA +2 -2
- {livekit_plugins_google-1.2.7.dist-info → livekit_plugins_google-1.2.9.dist-info}/RECORD +7 -7
- {livekit_plugins_google-1.2.7.dist-info → livekit_plugins_google-1.2.9.dist-info}/WHEEL +0 -0
|
@@ -202,6 +202,7 @@ class RealtimeModel(llm.RealtimeModel):
|
|
|
202
202
|
user_transcription=input_audio_transcription is not None,
|
|
203
203
|
auto_tool_reply_generation=True,
|
|
204
204
|
audio_output=types.Modality.AUDIO in modalities,
|
|
205
|
+
manual_function_calls=False,
|
|
205
206
|
)
|
|
206
207
|
)
|
|
207
208
|
|
|
@@ -775,7 +776,7 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
775
776
|
),
|
|
776
777
|
language_code=self._opts.language if is_given(self._opts.language) else None,
|
|
777
778
|
),
|
|
778
|
-
tools=tools_config,
|
|
779
|
+
tools=tools_config,
|
|
779
780
|
input_audio_transcription=self._opts.input_audio_transcription,
|
|
780
781
|
output_audio_transcription=self._opts.output_audio_transcription,
|
|
781
782
|
session_resumption=types.SessionResumptionConfig(
|
|
@@ -969,7 +970,7 @@ class RealtimeSession(llm.RealtimeSession):
|
|
|
969
970
|
gen.function_ch.send_nowait(
|
|
970
971
|
llm.FunctionCall(
|
|
971
972
|
call_id=fnc_call.id or utils.shortuuid("fnc-call-"),
|
|
972
|
-
name=fnc_call.name,
|
|
973
|
+
name=fnc_call.name,
|
|
973
974
|
arguments=arguments,
|
|
974
975
|
)
|
|
975
976
|
)
|
livekit/plugins/google/llm.py
CHANGED
|
@@ -423,7 +423,7 @@ class LLMStream(llm.LLMStream):
|
|
|
423
423
|
tool_calls=[
|
|
424
424
|
llm.FunctionToolCall(
|
|
425
425
|
arguments=json.dumps(part.function_call.args),
|
|
426
|
-
name=part.function_call.name,
|
|
426
|
+
name=part.function_call.name,
|
|
427
427
|
call_id=part.function_call.id or utils.shortuuid("function_call_"),
|
|
428
428
|
)
|
|
429
429
|
],
|
livekit/plugins/google/tts.py
CHANGED
|
@@ -52,6 +52,7 @@ class _TTSOptions:
|
|
|
52
52
|
volume_gain_db: float
|
|
53
53
|
custom_pronunciations: CustomPronunciations | None
|
|
54
54
|
enable_ssml: bool
|
|
55
|
+
use_markup: bool
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
class TTS(tts.TTS):
|
|
@@ -75,6 +76,7 @@ class TTS(tts.TTS):
|
|
|
75
76
|
custom_pronunciations: NotGivenOr[CustomPronunciations] = NOT_GIVEN,
|
|
76
77
|
use_streaming: bool = True,
|
|
77
78
|
enable_ssml: bool = False,
|
|
79
|
+
use_markup: bool = False,
|
|
78
80
|
) -> None:
|
|
79
81
|
"""
|
|
80
82
|
Create a new instance of Google TTS.
|
|
@@ -100,6 +102,7 @@ class TTS(tts.TTS):
|
|
|
100
102
|
custom_pronunciations (CustomPronunciations, optional): Custom pronunciations for the TTS. Default is None.
|
|
101
103
|
use_streaming (bool, optional): Whether to use streaming synthesis. Default is True.
|
|
102
104
|
enable_ssml (bool, optional): Whether to enable SSML support. Default is False.
|
|
105
|
+
use_markup (bool, optional): Whether to enable markup input for HD voices. Default is False.
|
|
103
106
|
""" # noqa: E501
|
|
104
107
|
super().__init__(
|
|
105
108
|
capabilities=tts.TTSCapabilities(streaming=use_streaming),
|
|
@@ -107,8 +110,11 @@ class TTS(tts.TTS):
|
|
|
107
110
|
num_channels=1,
|
|
108
111
|
)
|
|
109
112
|
|
|
110
|
-
if enable_ssml
|
|
111
|
-
|
|
113
|
+
if enable_ssml:
|
|
114
|
+
if use_streaming:
|
|
115
|
+
raise ValueError("SSML support is not available for streaming synthesis")
|
|
116
|
+
if use_markup:
|
|
117
|
+
raise ValueError("SSML support is not available for markup input")
|
|
112
118
|
|
|
113
119
|
self._client: texttospeech.TextToSpeechAsyncClient | None = None
|
|
114
120
|
self._credentials_info = credentials_info
|
|
@@ -145,6 +151,7 @@ class TTS(tts.TTS):
|
|
|
145
151
|
volume_gain_db=volume_gain_db,
|
|
146
152
|
custom_pronunciations=pronunciations,
|
|
147
153
|
enable_ssml=enable_ssml,
|
|
154
|
+
use_markup=use_markup,
|
|
148
155
|
)
|
|
149
156
|
self._streams = weakref.WeakSet[SynthesizeStream]()
|
|
150
157
|
|
|
@@ -238,19 +245,21 @@ class ChunkedStream(tts.ChunkedStream):
|
|
|
238
245
|
|
|
239
246
|
async def _run(self, output_emitter: tts.AudioEmitter) -> None:
|
|
240
247
|
try:
|
|
241
|
-
|
|
242
|
-
texttospeech.SynthesisInput(
|
|
243
|
-
|
|
244
|
-
custom_pronunciations=self._opts.custom_pronunciations,
|
|
248
|
+
if self._opts.use_markup:
|
|
249
|
+
tts_input = texttospeech.SynthesisInput(
|
|
250
|
+
markup=self._input_text, custom_pronunciations=self._opts.custom_pronunciations
|
|
245
251
|
)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
custom_pronunciations=self._opts.custom_pronunciations,
|
|
252
|
+
elif self._opts.enable_ssml:
|
|
253
|
+
tts_input = texttospeech.SynthesisInput(
|
|
254
|
+
ssml=self._build_ssml(), custom_pronunciations=self._opts.custom_pronunciations
|
|
250
255
|
)
|
|
251
|
-
|
|
256
|
+
else:
|
|
257
|
+
tts_input = texttospeech.SynthesisInput(
|
|
258
|
+
text=self._input_text, custom_pronunciations=self._opts.custom_pronunciations
|
|
259
|
+
)
|
|
260
|
+
|
|
252
261
|
response: SynthesizeSpeechResponse = await self._tts._ensure_client().synthesize_speech(
|
|
253
|
-
input=
|
|
262
|
+
input=tts_input,
|
|
254
263
|
voice=self._opts.voice,
|
|
255
264
|
audio_config=texttospeech.AudioConfig(
|
|
256
265
|
audio_encoding=self._opts.encoding,
|
|
@@ -355,8 +364,12 @@ class SynthesizeStream(tts.SynthesizeStream):
|
|
|
355
364
|
|
|
356
365
|
async for input in input_stream:
|
|
357
366
|
self._mark_started()
|
|
358
|
-
yield
|
|
359
|
-
|
|
367
|
+
yield (
|
|
368
|
+
texttospeech.StreamingSynthesizeRequest(
|
|
369
|
+
input=texttospeech.StreamingSynthesisInput(markup=input.token)
|
|
370
|
+
if self._opts.use_markup
|
|
371
|
+
else texttospeech.StreamingSynthesisInput(text=input.token)
|
|
372
|
+
)
|
|
360
373
|
)
|
|
361
374
|
|
|
362
375
|
except Exception:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: livekit-plugins-google
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.9
|
|
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.9
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
28
|
# Google AI plugin for LiveKit Agents
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
livekit/plugins/google/__init__.py,sha256=XIyZ-iFnRBpaLtOJgVwojlB-a8GjdDugVFcjBpMEww8,1412
|
|
2
|
-
livekit/plugins/google/llm.py,sha256=
|
|
2
|
+
livekit/plugins/google/llm.py,sha256=aeeGqhbEScbEs-GKp1T8rLocNqmvG4UBj6diekYe4FU,18809
|
|
3
3
|
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
|
4
4
|
livekit/plugins/google/models.py,sha256=poOvUBvgpqmmQV5EUQsq0RgNIRAq7nH-_IZIcIfPSBI,2801
|
|
5
5
|
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
livekit/plugins/google/stt.py,sha256=gRhVRsfg3BPNkBJGG78QOxEia0mF1jBnI_Ckq1jxqIs,25938
|
|
7
7
|
livekit/plugins/google/tools.py,sha256=tD5HVDHO5JfUF029Cx3axHMJec0Gxalkl7s1FDgxLzI,259
|
|
8
|
-
livekit/plugins/google/tts.py,sha256=
|
|
8
|
+
livekit/plugins/google/tts.py,sha256=LBLP3pEq1iCCgfidpRTtpeoDKYmXh8PKeJf1llAsybQ,17302
|
|
9
9
|
livekit/plugins/google/utils.py,sha256=z0iCP6-hYix3JRm2RM5JOBEJCICehUe5N4FTl-JpXLc,9269
|
|
10
|
-
livekit/plugins/google/version.py,sha256=
|
|
10
|
+
livekit/plugins/google/version.py,sha256=qBF6bhFO57YNRku03dnWNtaFtkRztcLr4rdWnggtS84,600
|
|
11
11
|
livekit/plugins/google/beta/__init__.py,sha256=RvAUdvEiRN-fe4JrgPcN0Jkw1kZR9wPerGMFVjS1Cc0,270
|
|
12
12
|
livekit/plugins/google/beta/gemini_tts.py,sha256=esWjr0Xf95tl0_AB7MXiFZ_VCORWgcWjzvLvRa3t0FQ,8515
|
|
13
13
|
livekit/plugins/google/beta/realtime/__init__.py,sha256=_fW2NMN22F-hnQ4xAJ_g5lPbR7CvM_xXzSWlUQY-E-U,188
|
|
14
14
|
livekit/plugins/google/beta/realtime/api_proto.py,sha256=nb_QkVQDEH7h0SKA9vdS3JaL12a6t2Z1ja4SdnxE6a8,814
|
|
15
|
-
livekit/plugins/google/beta/realtime/realtime_api.py,sha256=
|
|
16
|
-
livekit_plugins_google-1.2.
|
|
17
|
-
livekit_plugins_google-1.2.
|
|
18
|
-
livekit_plugins_google-1.2.
|
|
15
|
+
livekit/plugins/google/beta/realtime/realtime_api.py,sha256=wmQQZB8lwreUxZ2ReMmWOutW1Hc6TiPTm53DBqdOJG0,47830
|
|
16
|
+
livekit_plugins_google-1.2.9.dist-info/METADATA,sha256=77Ltyq9ZFibheExEbFyZbFrs5ATnmEETBHn353cuxUk,1907
|
|
17
|
+
livekit_plugins_google-1.2.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
livekit_plugins_google-1.2.9.dist-info/RECORD,,
|
|
File without changes
|