livekit-plugins-google 1.1.5__py3-none-any.whl → 1.1.6__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.

@@ -13,7 +13,7 @@ LiveAPIModels = Literal[
13
13
  "gemini-2.5-flash-exp-native-audio-thinking-dialog",
14
14
  ]
15
15
 
16
- Voice = Literal["Puck", "Charon", "Kore", "Fenrir", "Aoede", "Leda", "Oru", "Zephyr"]
16
+ Voice = Literal["Puck", "Charon", "Kore", "Fenrir", "Aoede", "Leda", "Orus", "Zephyr"]
17
17
 
18
18
 
19
19
  ClientEvents = Union[
@@ -22,7 +22,11 @@ from dataclasses import dataclass, replace
22
22
  from google.api_core.client_options import ClientOptions
23
23
  from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
24
24
  from google.cloud import texttospeech
25
- from google.cloud.texttospeech_v1.types import SsmlVoiceGender, SynthesizeSpeechResponse
25
+ from google.cloud.texttospeech_v1.types import (
26
+ CustomPronunciations,
27
+ SsmlVoiceGender,
28
+ SynthesizeSpeechResponse,
29
+ )
26
30
  from livekit.agents import APIConnectOptions, APIStatusError, APITimeoutError, tokenize, tts, utils
27
31
  from livekit.agents.types import DEFAULT_API_CONNECT_OPTIONS, NOT_GIVEN, NotGivenOr
28
32
  from livekit.agents.utils import is_given
@@ -47,6 +51,7 @@ class _TTSOptions:
47
51
  speaking_rate: float
48
52
  tokenizer: tokenize.SentenceTokenizer
49
53
  volume_gain_db: float
54
+ custom_pronunciations: CustomPronunciations | None
50
55
  enable_ssml: bool
51
56
 
52
57
 
@@ -67,6 +72,7 @@ class TTS(tts.TTS):
67
72
  credentials_info: NotGivenOr[dict] = NOT_GIVEN,
68
73
  credentials_file: NotGivenOr[str] = NOT_GIVEN,
69
74
  tokenizer: NotGivenOr[tokenize.SentenceTokenizer] = NOT_GIVEN,
75
+ custom_pronunciations: NotGivenOr[CustomPronunciations] = NOT_GIVEN,
70
76
  use_streaming: bool = True,
71
77
  enable_ssml: bool = False,
72
78
  ) -> None:
@@ -90,6 +96,7 @@ class TTS(tts.TTS):
90
96
  credentials_info (dict, optional): Dictionary containing Google Cloud credentials. Default is None.
91
97
  credentials_file (str, optional): Path to the Google Cloud credentials JSON file. Default is None.
92
98
  tokenizer (tokenize.SentenceTokenizer, optional): Tokenizer for the TTS. Default is a basic sentence tokenizer.
99
+ custom_pronunciations (CustomPronunciations, optional): Custom pronunciations for the TTS. Default is None.
93
100
  use_streaming (bool, optional): Whether to use streaming synthesis. Default is True.
94
101
  enable_ssml (bool, optional): Whether to enable SSML support. Default is False.
95
102
  """ # noqa: E501
@@ -119,6 +126,8 @@ class TTS(tts.TTS):
119
126
  if not is_given(tokenizer):
120
127
  tokenizer = tokenize.basic.SentenceTokenizer(min_sentence_len=BUFFERED_WORDS_COUNT)
121
128
 
129
+ pronunciations = None if not is_given(custom_pronunciations) else custom_pronunciations
130
+
122
131
  self._opts = _TTSOptions(
123
132
  voice=voice_params,
124
133
  encoding=audio_encoding,
@@ -128,6 +137,7 @@ class TTS(tts.TTS):
128
137
  speaking_rate=speaking_rate,
129
138
  tokenizer=tokenizer,
130
139
  volume_gain_db=volume_gain_db,
140
+ custom_pronunciations=pronunciations,
131
141
  enable_ssml=enable_ssml,
132
142
  )
133
143
  self._streams = weakref.WeakSet[SynthesizeStream]()
@@ -223,9 +233,15 @@ class ChunkedStream(tts.ChunkedStream):
223
233
  async def _run(self, output_emitter: tts.AudioEmitter) -> None:
224
234
  try:
225
235
  input = (
226
- texttospeech.SynthesisInput(ssml=self._build_ssml())
236
+ texttospeech.SynthesisInput(
237
+ ssml=self._build_ssml(),
238
+ custom_pronunciations=self._opts.custom_pronunciations,
239
+ )
227
240
  if self._opts.enable_ssml
228
- else texttospeech.SynthesisInput(text=self._input_text)
241
+ else texttospeech.SynthesisInput(
242
+ text=self._input_text,
243
+ custom_pronunciations=self._opts.custom_pronunciations,
244
+ )
229
245
  )
230
246
  response: SynthesizeSpeechResponse = await self._tts._ensure_client().synthesize_speech(
231
247
  input=input,
@@ -287,6 +303,7 @@ class SynthesizeStream(tts.SynthesizeStream):
287
303
  sample_rate_hertz=self._opts.sample_rate,
288
304
  speaking_rate=self._opts.speaking_rate,
289
305
  ),
306
+ custom_pronunciations=self._opts.custom_pronunciations,
290
307
  )
291
308
 
292
309
  async def _tokenize_input() -> 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__ = "1.1.5"
15
+ __version__ = "1.1.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-google
3
- Version: 1.1.5
3
+ Version: 1.1.6
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.1.5
25
+ Requires-Dist: livekit-agents>=1.1.6
26
26
  Description-Content-Type: text/markdown
27
27
 
28
28
  # Google AI plugin for LiveKit Agents
@@ -5,13 +5,13 @@ livekit/plugins/google/models.py,sha256=hOpfbN_qdQ1ZTpCN9m9dvG2eb6WgQ3KE3WRpIeeM
5
5
  livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  livekit/plugins/google/stt.py,sha256=ssDMH5U1vQOLA44XMlovYWIR4UqVtZSge3YFN-zZ7Iw,24696
7
7
  livekit/plugins/google/tools.py,sha256=tD5HVDHO5JfUF029Cx3axHMJec0Gxalkl7s1FDgxLzI,259
8
- livekit/plugins/google/tts.py,sha256=YTfce55MWNJyDH4k8U1O2giOcrtccTs8vrkiW9GuBR0,15541
8
+ livekit/plugins/google/tts.py,sha256=QVM4xcF7WHpbQOZDAhRJrz481iMhO9ACjjqPEdTT4Lw,16277
9
9
  livekit/plugins/google/utils.py,sha256=6iihkKx76DDtLiHOoTU2ZXqzupBRY_gN3njpnwdmeqY,8829
10
- livekit/plugins/google/version.py,sha256=OKtayGMVDYKyoKBO2yNM4kfRbH-PODJqECIiYhUzNWg,600
10
+ livekit/plugins/google/version.py,sha256=-bNd31cMcYCdhZCIKJ1-jtY4NgZvppVgKyzXAIzQtqM,600
11
11
  livekit/plugins/google/beta/__init__.py,sha256=5PnoG3Ux24bjzMSzmTeSVljE9EINivGcbWUEV6egGnM,216
12
12
  livekit/plugins/google/beta/realtime/__init__.py,sha256=_fW2NMN22F-hnQ4xAJ_g5lPbR7CvM_xXzSWlUQY-E-U,188
13
- livekit/plugins/google/beta/realtime/api_proto.py,sha256=NfE7xr2N3JOu7gVfWbAmDcEhs8vuZgMRu5vpScPJzsg,776
13
+ livekit/plugins/google/beta/realtime/api_proto.py,sha256=cbKmpX32G4gPjF6cxFNzGEDfYX19SK-vWi4Myxb8Yks,777
14
14
  livekit/plugins/google/beta/realtime/realtime_api.py,sha256=tlAsTFsumqOavC9JT2SuQi_3eGYygZ3bbS-nEM7ea8Q,46293
15
- livekit_plugins_google-1.1.5.dist-info/METADATA,sha256=g6aRR1VIspmPtZ2C6VQ-cqZWx1gIpLtg4OFV1pbD01E,1907
16
- livekit_plugins_google-1.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- livekit_plugins_google-1.1.5.dist-info/RECORD,,
15
+ livekit_plugins_google-1.1.6.dist-info/METADATA,sha256=mxBww_GRBSqdB7Djd5iZYZmik-gDD2wtTRS3i0qRbDs,1907
16
+ livekit_plugins_google-1.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ livekit_plugins_google-1.1.6.dist-info/RECORD,,