livekit-plugins-hume 1.2.3__py3-none-any.whl → 1.3.5__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.
@@ -34,6 +34,7 @@ from .version import __version__
34
34
  __all__ = [
35
35
  "TTS",
36
36
  "AudioFormat",
37
+ "ModelVersion",
37
38
  "VoiceById",
38
39
  "VoiceByName",
39
40
  "VoiceProvider",
@@ -20,7 +20,7 @@ import json
20
20
  import os
21
21
  from dataclasses import dataclass, replace
22
22
  from enum import Enum
23
- from typing import Any, TypedDict
23
+ from typing import Any, Literal, TypedDict
24
24
 
25
25
  import aiohttp
26
26
 
@@ -73,6 +73,9 @@ class AudioFormat(str, Enum):
73
73
  pcm = "pcm"
74
74
 
75
75
 
76
+ ModelVersion = Literal["1", "2"]
77
+
78
+
76
79
  DEFAULT_HEADERS = {
77
80
  "X-Hume-Client-Name": "livekit",
78
81
  "X-Hume-Client-Version": __version__,
@@ -89,6 +92,7 @@ class _TTSOptions:
89
92
  api_key: str
90
93
  base_url: str
91
94
  voice: VoiceById | VoiceByName | None
95
+ model_version: ModelVersion | None
92
96
  description: str | None
93
97
  speed: float | None
94
98
  trailing_silence: float | None
@@ -106,6 +110,7 @@ class TTS(tts.TTS):
106
110
  *,
107
111
  api_key: str | None = None,
108
112
  voice: VoiceById | VoiceByName | None = DEFAULT_VOICE,
113
+ model_version: ModelVersion | None = "1",
109
114
  description: str | None = None,
110
115
  speed: float | None = None,
111
116
  trailing_silence: float | None = None,
@@ -121,10 +126,12 @@ class TTS(tts.TTS):
121
126
  Args:
122
127
  api_key: Hume AI API key. If not provided, will look for HUME_API_KEY environment
123
128
  variable.
124
- voice: A voice from the voice library specifed by name or id.
129
+ voice: A voice from the voice library specified by name or id.
130
+ model_version: Specifies which version of Octave to use. See Hume's documentation for
131
+ details on model version differences: https://dev.hume.ai/docs/text-to-speech-tts/overview.
125
132
  description: Natural language instructions describing how the synthesized speech
126
133
  should sound (≤1000 characters).
127
- speed: Speed multiplier for the synthesized speech (≥0.25, ≤3.0, default: 1.0).
134
+ speed: Speed multiplier for the synthesized speech (≥0.5, ≤2.0, default: 1.0).
128
135
  trailing_silence: Duration of trailing silence (in seconds) to add to each utterance
129
136
  (≥0, ≤5.0, default: 0.35).
130
137
  context: Optional context for synthesis, either as text or list of utterances.
@@ -157,6 +164,7 @@ class TTS(tts.TTS):
157
164
  self._opts = _TTSOptions(
158
165
  api_key=key,
159
166
  voice=voice,
167
+ model_version=model_version,
160
168
  description=description,
161
169
  speed=speed,
162
170
  trailing_silence=trailing_silence,
@@ -167,6 +175,14 @@ class TTS(tts.TTS):
167
175
  )
168
176
  self._session = http_session
169
177
 
178
+ @property
179
+ def model(self) -> str:
180
+ return "Octave"
181
+
182
+ @property
183
+ def provider(self) -> str:
184
+ return "Hume"
185
+
170
186
  def _ensure_session(self) -> aiohttp.ClientSession:
171
187
  if not self._session:
172
188
  self._session = utils.http_context.http_session()
@@ -187,10 +203,10 @@ class TTS(tts.TTS):
187
203
  """Update TTS options used for all future synthesis (until updated again)
188
204
 
189
205
  Args:
190
- voice: A voice from the voice library specifed by name or id.
206
+ voice: A voice from the voice library specified by name or id.
191
207
  description: Natural language instructions describing how the synthesized speech
192
208
  should sound (≤1000 characters).
193
- speed: Speed multiplier for the synthesized speech (≥0.25, ≤3.0, default: 1.0).
209
+ speed: Speed multiplier for the synthesized speech (≥0.5, ≤2.0, default: 1.0).
194
210
  trailing_silence: Duration of trailing silence (in seconds) to add to each utterance.
195
211
  context: Optional context for synthesis, either as text or list of utterances.
196
212
  instant_mode: Whether to use instant mode.
@@ -239,6 +255,7 @@ class ChunkedStream(tts.ChunkedStream):
239
255
 
240
256
  payload: dict[str, Any] = {
241
257
  "utterances": [utterance],
258
+ "version": self._opts.model_version,
242
259
  "strip_headers": True,
243
260
  "instant_mode": self._opts.instant_mode,
244
261
  "format": {"type": self._opts.audio_format.value},
@@ -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.3"
15
+ __version__ = "1.3.5"
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-hume
3
- Version: 1.2.3
3
+ Version: 1.3.5
4
4
  Summary: Hume TTS plugin for LiveKit agents
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-email: LiveKit <info@livekit.io>
9
9
  License-Expression: Apache-2.0
10
- Keywords: Hume,HumeAI,Octave,audio,livekit,realtime,webrtc
10
+ Keywords: Hume,HumeAI,Octave,ai,audio,livekit,realtime,video,voice
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -17,7 +17,7 @@ Classifier: Topic :: Multimedia :: Sound/Audio
17
17
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
18
  Requires-Python: >=3.9.0
19
19
  Requires-Dist: aiohttp>=3.8.0
20
- Requires-Dist: livekit-agents>=1.2.3
20
+ Requires-Dist: livekit-agents>=1.3.5
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # Hume AI TTS plugin for LiveKit Agents
@@ -0,0 +1,8 @@
1
+ livekit/plugins/hume/__init__.py,sha256=fhNNbmemEtPTM4Qwsi6-q3wDGyIcywHc4z9hMawQmjk,1394
2
+ livekit/plugins/hume/log.py,sha256=TwpK1FOwgD6Jb0A2nl-9nIgi0q5qWo9HGDrDuV_2g0g,67
3
+ livekit/plugins/hume/py.typed,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
4
+ livekit/plugins/hume/tts.py,sha256=12dM7n7eoLspJoBn3_eS6BwCqpSLHyBIk17iza8yAOA,11015
5
+ livekit/plugins/hume/version.py,sha256=6H-6MQWvTBz1H6-_Ga4YEOkRJyH3Sy6H1ZSzAC2CJFU,600
6
+ livekit_plugins_hume-1.3.5.dist-info/METADATA,sha256=WnbsxbcVzTgLvXWoC2ibl1VChI7SDFYYTpphz7rzjwg,1362
7
+ livekit_plugins_hume-1.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ livekit_plugins_hume-1.3.5.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- livekit/plugins/hume/__init__.py,sha256=yYTwSJaYq5ufZ_EnoSuLa2FfSsnOZu-swAzYjNQAhhw,1374
2
- livekit/plugins/hume/log.py,sha256=TwpK1FOwgD6Jb0A2nl-9nIgi0q5qWo9HGDrDuV_2g0g,67
3
- livekit/plugins/hume/py.typed,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
4
- livekit/plugins/hume/tts.py,sha256=LamNG1FxMKPm4NhV4wXJVu9u-fMaiZB_Qby_VpWjTfY,10451
5
- livekit/plugins/hume/version.py,sha256=HPlGgKoRBGGxd2wALrVSaLRImqWgzvVFpznNIABDgU8,600
6
- livekit_plugins_hume-1.2.3.dist-info/METADATA,sha256=3oWceDx5g17_yDvseuBVCm3cWQsjUFcUAoqfIsp3--8,1354
7
- livekit_plugins_hume-1.2.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- livekit_plugins_hume-1.2.3.dist-info/RECORD,,