dv-pipecat-ai 0.0.85.dev840__py3-none-any.whl → 0.0.85.dev841__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dv-pipecat-ai
3
- Version: 0.0.85.dev840
3
+ Version: 0.0.85.dev841
4
4
  Summary: An open source framework for voice (and multimodal) assistants
5
5
  License-Expression: BSD-2-Clause
6
6
  Project-URL: Source, https://github.com/pipecat-ai/pipecat
@@ -1,4 +1,4 @@
1
- dv_pipecat_ai-0.0.85.dev840.dist-info/licenses/LICENSE,sha256=DWY2QGf2eMCFhuu2ChairtT6CB7BEFffNVhXWc4Od08,1301
1
+ dv_pipecat_ai-0.0.85.dev841.dist-info/licenses/LICENSE,sha256=DWY2QGf2eMCFhuu2ChairtT6CB7BEFffNVhXWc4Od08,1301
2
2
  pipecat/__init__.py,sha256=j0Xm6adxHhd7D06dIyyPV_GlBYLlBnTAERVvD_jAARQ,861
3
3
  pipecat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  pipecat/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -329,7 +329,7 @@ pipecat/services/sarvam/tts.py,sha256=lrwfdC53kZ7f2QPgNRxzryISNkrJCvNtlZ-19-iXg9
329
329
  pipecat/services/simli/__init__.py,sha256=cbDcqOaGsEgKbGYKpJ1Vv7LN4ZjOWA04sE84WW5vgQI,257
330
330
  pipecat/services/simli/video.py,sha256=Zu2XLvl2Y6VHaWzT9wEdzW9d0EYoZyzYLxjQFyV8vho,8320
331
331
  pipecat/services/soniox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
332
- pipecat/services/soniox/stt.py,sha256=AhJF2YOzmqgB80x22jocgzr3neYCBMyxzP_WjkYR9Gc,15441
332
+ pipecat/services/soniox/stt.py,sha256=Ndml6QvPQ1WZBvdGT3LSg-LLWwrZ8KlqW8wBBFsQrrM,16509
333
333
  pipecat/services/speechmatics/__init__.py,sha256=Jgq1fqrZVkpWC21D79L1cn5Ub8PnYgnnCaqC5pOlbIc,89
334
334
  pipecat/services/speechmatics/stt.py,sha256=GLGJzlMSeZ1WzTOMjhKXDl5JYkqGhnFTbP3o0ez0hSw,44696
335
335
  pipecat/services/tavus/__init__.py,sha256=SNyyi2Xq6tXIihDG2Bwvmg6Srbd-uWd1RwG-NKWcPuI,257
@@ -416,7 +416,7 @@ pipecat/utils/tracing/service_decorators.py,sha256=fwzxFpi8DJl6BJbK74G0UEB4ccMJg
416
416
  pipecat/utils/tracing/setup.py,sha256=7TEgPNpq6M8lww8OQvf0P9FzYc5A30xICGklVA-fua0,2892
417
417
  pipecat/utils/tracing/turn_context_provider.py,sha256=ikon3plFOx0XbMrH6DdeHttNpb-U0gzMZIm3bWLc9eI,2485
418
418
  pipecat/utils/tracing/turn_trace_observer.py,sha256=dma16SBJpYSOE58YDWy89QzHyQFc_9gQZszKeWixuwc,9725
419
- dv_pipecat_ai-0.0.85.dev840.dist-info/METADATA,sha256=ALfdKasSbWLkqVlc0XSkl9lo6qzO7Wpior0WxVFzWZk,32955
420
- dv_pipecat_ai-0.0.85.dev840.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
421
- dv_pipecat_ai-0.0.85.dev840.dist-info/top_level.txt,sha256=kQzG20CxGf-nSsHmtXHx3hY2-8zHA3jYg8jk0TajqXc,8
422
- dv_pipecat_ai-0.0.85.dev840.dist-info/RECORD,,
419
+ dv_pipecat_ai-0.0.85.dev841.dist-info/METADATA,sha256=xq4O-F0nWpeT1pXQ6uVPqT-eYvdnGrm_ktReRPPqrYo,32955
420
+ dv_pipecat_ai-0.0.85.dev841.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
421
+ dv_pipecat_ai-0.0.85.dev841.dist-info/top_level.txt,sha256=kQzG20CxGf-nSsHmtXHx3hY2-8zHA3jYg8jk0TajqXc,8
422
+ dv_pipecat_ai-0.0.85.dev841.dist-info/RECORD,,
@@ -49,6 +49,33 @@ END_TOKEN = "<end>"
49
49
  FINALIZED_TOKEN = "<fin>"
50
50
 
51
51
 
52
+ class SonioxContextGeneralItem(BaseModel):
53
+ """Represents a key-value pair for structured general context information."""
54
+
55
+ key: str
56
+ value: str
57
+
58
+
59
+ class SonioxContextTranslationTerm(BaseModel):
60
+ """Represents a custom translation mapping for ambiguous or domain-specific terms."""
61
+
62
+ source: str
63
+ target: str
64
+
65
+
66
+ class SonioxContextObject(BaseModel):
67
+ """Context object for models with context_version 2, for Soniox stt-rt-v3-preview and higher.
68
+
69
+ Learn more about context in the documentation:
70
+ https://soniox.com/docs/stt/concepts/context
71
+ """
72
+
73
+ general: Optional[List[SonioxContextGeneralItem]] = None
74
+ text: Optional[str] = None
75
+ terms: Optional[List[str]] = None
76
+ translation_terms: Optional[List[SonioxContextTranslationTerm]] = None
77
+
78
+
52
79
  class SonioxInputParams(BaseModel):
53
80
  """Real-time transcription settings.
54
81
 
@@ -60,9 +87,9 @@ class SonioxInputParams(BaseModel):
60
87
  audio_format: Audio format to use for transcription.
61
88
  num_channels: Number of channels to use for transcription.
62
89
  language_hints: List of language hints to use for transcription.
63
- context: Customization for transcription.
64
- enable_non_final_tokens: Whether to enable non-final tokens. If false, only final tokens will be returned.
65
- max_non_final_tokens_duration_ms: Maximum duration of non-final tokens.
90
+ context: Customization for transcription. String for models with context_version 1 and ContextObject for models with context_version 2.
91
+ enable_speaker_diarization: Whether to enable speaker diarization. Tokens are annotated with speaker IDs.
92
+ enable_language_identification: Whether to enable language identification. Tokens are annotated with language IDs.
66
93
  client_reference_id: Client reference ID to use for transcription.
67
94
  """
68
95
 
@@ -72,10 +99,10 @@ class SonioxInputParams(BaseModel):
72
99
  num_channels: Optional[int] = 1
73
100
 
74
101
  language_hints: Optional[List[Language]] = None
75
- context: Optional[str] = None
102
+ context: Optional[SonioxContextObject | str] = None
76
103
 
77
- enable_non_final_tokens: Optional[bool] = True
78
- max_non_final_tokens_duration_ms: Optional[int] = None
104
+ enable_speaker_diarization: Optional[bool] = False
105
+ enable_language_identification: Optional[bool] = False
79
106
 
80
107
  client_reference_id: Optional[str] = None
81
108
 
@@ -173,6 +200,10 @@ class SonioxSTTService(STTService):
173
200
  # Either one or the other is required.
174
201
  enable_endpoint_detection = not self._vad_force_turn_endpoint
175
202
 
203
+ context = self._params.context
204
+ if isinstance(context, SonioxContextObject):
205
+ context = context.model_dump()
206
+
176
207
  # Send the initial configuration message.
177
208
  config = {
178
209
  "api_key": self._api_key,
@@ -182,9 +213,9 @@ class SonioxSTTService(STTService):
182
213
  "enable_endpoint_detection": enable_endpoint_detection,
183
214
  "sample_rate": self.sample_rate,
184
215
  "language_hints": _prepare_language_hints(self._params.language_hints),
185
- "context": self._params.context,
186
- "enable_non_final_tokens": self._params.enable_non_final_tokens,
187
- "max_non_final_tokens_duration_ms": self._params.max_non_final_tokens_duration_ms,
216
+ "context": context,
217
+ "enable_speaker_diarization": self._params.enable_speaker_diarization,
218
+ "enable_language_identification": self._params.enable_language_identification,
188
219
  "client_reference_id": self._params.client_reference_id,
189
220
  }
190
221