dv-pipecat-ai 0.0.85.dev854__py3-none-any.whl → 0.0.85.dev856__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 dv-pipecat-ai might be problematic. Click here for more details.
- {dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/METADATA +1 -1
- {dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/RECORD +7 -7
- pipecat/services/elevenlabs/stt.py +6 -40
- pipecat/transcriptions/language.py +50 -0
- {dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/WHEEL +0 -0
- {dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/licenses/LICENSE +0 -0
- {dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
dv_pipecat_ai-0.0.85.
|
|
1
|
+
dv_pipecat_ai-0.0.85.dev856.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
|
|
@@ -217,7 +217,7 @@ pipecat/services/deepgram/flux/stt.py,sha256=yCZodrHAOShgYy_GbdviX8iAuh36dBgDL41
|
|
|
217
217
|
pipecat/services/deepseek/__init__.py,sha256=bU5z_oNGzgrF_YpsD9pYIMtEibeZFaUobbRjJ9WcYyE,259
|
|
218
218
|
pipecat/services/deepseek/llm.py,sha256=5KjpU2blmhUTM3LcRE1ymdsk6OmoFkIzeQgyNOGwQh8,3112
|
|
219
219
|
pipecat/services/elevenlabs/__init__.py,sha256=cMx5v0HEMh4WetMm5byR9tIjG6_wNVs9UxqWyB3tjlM,313
|
|
220
|
-
pipecat/services/elevenlabs/stt.py,sha256=
|
|
220
|
+
pipecat/services/elevenlabs/stt.py,sha256=c-6GDeyZCMcXu4FmcG0vugBRsUnq8Iz_L9XX_Y_8TlM,29453
|
|
221
221
|
pipecat/services/elevenlabs/tts.py,sha256=skUndgUatx2F5rjg2tBZLutB8k9B9Cjy-cUeglCDdwc,45314
|
|
222
222
|
pipecat/services/fal/__init__.py,sha256=z_kfZETvUcKy68Lyvni4B-RtdkOvz3J3eh6sFDVKq6M,278
|
|
223
223
|
pipecat/services/fal/image.py,sha256=vArKLKrIGoZfw_xeZY_E7zbUzfzVsScj-R7mOmVqjRQ,4585
|
|
@@ -351,7 +351,7 @@ pipecat/sync/event_notifier.py,sha256=h50fC-RBGaGldWZx_wpgOmMIwJiq0PeNwQq5GPmfRR
|
|
|
351
351
|
pipecat/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
352
352
|
pipecat/tests/utils.py,sha256=DEHDQV8uhCuKIqoHUPGVdUoCiKqTCG9zv5GqLXWWwvY,7870
|
|
353
353
|
pipecat/transcriptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
354
|
-
pipecat/transcriptions/language.py,sha256
|
|
354
|
+
pipecat/transcriptions/language.py,sha256=9kqmqCJF2NUTksWn0TH7-huRwtDqQzzALKzF1CnK_cY,10106
|
|
355
355
|
pipecat/transports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
356
356
|
pipecat/transports/base_input.py,sha256=AkdE-j9UksjIrUGJc7laMOaknXgOS7L22D5sehZ-6ew,20176
|
|
357
357
|
pipecat/transports/base_output.py,sha256=T_NfU38sT6wKxXF1jA7hW5eLhTK11pundQBxAojswW8,36723
|
|
@@ -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.
|
|
420
|
-
dv_pipecat_ai-0.0.85.
|
|
421
|
-
dv_pipecat_ai-0.0.85.
|
|
422
|
-
dv_pipecat_ai-0.0.85.
|
|
419
|
+
dv_pipecat_ai-0.0.85.dev856.dist-info/METADATA,sha256=61LBrVZvlHne5jwbVTqjC0ZEtrErzfnhK5IXbIHs0Sk,32955
|
|
420
|
+
dv_pipecat_ai-0.0.85.dev856.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
421
|
+
dv_pipecat_ai-0.0.85.dev856.dist-info/top_level.txt,sha256=kQzG20CxGf-nSsHmtXHx3hY2-8zHA3jYg8jk0TajqXc,8
|
|
422
|
+
dv_pipecat_ai-0.0.85.dev856.dist-info/RECORD,,
|
|
@@ -34,7 +34,7 @@ from pipecat.frames.frames import (
|
|
|
34
34
|
)
|
|
35
35
|
from pipecat.processors.frame_processor import FrameDirection
|
|
36
36
|
from pipecat.services.stt_service import SegmentedSTTService, WebsocketSTTService
|
|
37
|
-
from pipecat.transcriptions.language import Language
|
|
37
|
+
from pipecat.transcriptions.language import Language, resolve_language
|
|
38
38
|
from pipecat.utils.time import time_now_iso8601
|
|
39
39
|
from pipecat.utils.tracing.service_decorators import traced_stt
|
|
40
40
|
|
|
@@ -61,7 +61,7 @@ def language_to_elevenlabs_language(language: Language) -> Optional[str]:
|
|
|
61
61
|
Returns:
|
|
62
62
|
The corresponding ElevenLabs language code, or None if not supported.
|
|
63
63
|
"""
|
|
64
|
-
|
|
64
|
+
LANGUAGE_MAP = {
|
|
65
65
|
Language.AF: "afr", # Afrikaans
|
|
66
66
|
Language.AM: "amh", # Amharic
|
|
67
67
|
Language.AR: "ara", # Arabic
|
|
@@ -163,21 +163,7 @@ def language_to_elevenlabs_language(language: Language) -> Optional[str]:
|
|
|
163
163
|
Language.ZU: "zul", # Zulu
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
# If not found in base languages, try to find the base language from a variant
|
|
169
|
-
# For example, Language.EN_US (value "en-US") -> Language("en") -> "eng"
|
|
170
|
-
if not result:
|
|
171
|
-
lang_str = str(language.value)
|
|
172
|
-
base_code = lang_str.split("-")[0] # Get "en" from "en-US"
|
|
173
|
-
try:
|
|
174
|
-
base_language = Language(base_code)
|
|
175
|
-
result = BASE_LANGUAGES.get(base_language)
|
|
176
|
-
except (ValueError, KeyError):
|
|
177
|
-
# If base language not found in Language enum, return None
|
|
178
|
-
result = None
|
|
179
|
-
|
|
180
|
-
return result
|
|
166
|
+
return resolve_language(language, LANGUAGE_MAP, use_base_code=False)
|
|
181
167
|
|
|
182
168
|
|
|
183
169
|
class ElevenLabsSTTService(SegmentedSTTService):
|
|
@@ -365,8 +351,8 @@ class ElevenLabsSTTService(SegmentedSTTService):
|
|
|
365
351
|
)
|
|
366
352
|
|
|
367
353
|
except Exception as e:
|
|
368
|
-
logger.error(f"
|
|
369
|
-
yield ErrorFrame(f"
|
|
354
|
+
logger.error(f"{self} exception: {e}")
|
|
355
|
+
yield ErrorFrame(error=f"{self} error: {e}")
|
|
370
356
|
|
|
371
357
|
|
|
372
358
|
def audio_format_from_sample_rate(sample_rate: int) -> str:
|
|
@@ -414,12 +400,6 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
|
|
|
414
400
|
|
|
415
401
|
By default, uses manual commit strategy where Pipecat's VAD controls when to
|
|
416
402
|
commit transcript segments, providing consistency with other STT services.
|
|
417
|
-
|
|
418
|
-
Important:
|
|
419
|
-
When using manual commit strategy with Pipecat's VAD, it is recommended to set
|
|
420
|
-
the VAD `stop_secs` parameter to at least 0.5 seconds. Lower values may result
|
|
421
|
-
in incomplete transcriptions due to a known limitation in the ElevenLabs model
|
|
422
|
-
where audio sent near the commit boundary may not be fully processed.
|
|
423
403
|
"""
|
|
424
404
|
|
|
425
405
|
class InputParams(BaseModel):
|
|
@@ -436,11 +416,6 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
|
|
|
436
416
|
Only used when commit_strategy is VAD. None uses ElevenLabs default.
|
|
437
417
|
min_silence_duration_ms: Minimum silence duration for VAD (50-2000ms).
|
|
438
418
|
Only used when commit_strategy is VAD. None uses ElevenLabs default.
|
|
439
|
-
|
|
440
|
-
Note:
|
|
441
|
-
When using manual commit strategy, ensure Pipecat's VAD `stop_secs` is set to
|
|
442
|
-
at least 0.5 seconds to avoid incomplete transcriptions. This is a known
|
|
443
|
-
limitation of the ElevenLabs model.
|
|
444
419
|
"""
|
|
445
420
|
|
|
446
421
|
language_code: Optional[str] = None
|
|
@@ -469,10 +444,6 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
|
|
|
469
444
|
sample_rate: Audio sample rate in Hz. If not provided, uses the pipeline's rate.
|
|
470
445
|
params: Configuration parameters for the STT service.
|
|
471
446
|
**kwargs: Additional arguments passed to WebsocketSTTService.
|
|
472
|
-
|
|
473
|
-
Note:
|
|
474
|
-
When using manual commit strategy (default), configure Pipecat's VAD with
|
|
475
|
-
`stop_secs` of at least 0.5 seconds to ensure complete transcriptions.
|
|
476
447
|
"""
|
|
477
448
|
super().__init__(
|
|
478
449
|
sample_rate=sample_rate,
|
|
@@ -746,12 +717,7 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService):
|
|
|
746
717
|
logger.error(f"ElevenLabs input error: {error_msg}")
|
|
747
718
|
await self.push_error(ErrorFrame(f"Input error: {error_msg}"))
|
|
748
719
|
|
|
749
|
-
elif message_type in [
|
|
750
|
-
"auth_error",
|
|
751
|
-
"quota_exceeded",
|
|
752
|
-
"transcriber_error",
|
|
753
|
-
"error",
|
|
754
|
-
]:
|
|
720
|
+
elif message_type in ["auth_error", "quota_exceeded", "transcriber_error", "error"]:
|
|
755
721
|
error_msg = data.get("error", data.get("message", "Unknown error"))
|
|
756
722
|
logger.error(f"ElevenLabs error ({message_type}): {error_msg}")
|
|
757
723
|
await self.push_error(ErrorFrame(f"{message_type}: {error_msg}"))
|
|
@@ -569,3 +569,53 @@ class Language(StrEnum):
|
|
|
569
569
|
# Zulu
|
|
570
570
|
ZU = "zu"
|
|
571
571
|
ZU_ZA = "zu-ZA"
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
def resolve_language(
|
|
575
|
+
language: Language, language_map: dict[Language, str], use_base_code: bool = True
|
|
576
|
+
) -> str:
|
|
577
|
+
"""Resolve a Language enum to a service-specific language code.
|
|
578
|
+
|
|
579
|
+
Checks the language map first, then falls back to extracting the appropriate
|
|
580
|
+
code format with a warning if not found in the verified list.
|
|
581
|
+
|
|
582
|
+
Args:
|
|
583
|
+
language: The Language enum value to convert.
|
|
584
|
+
language_map: Dictionary mapping Language enums to service language codes.
|
|
585
|
+
use_base_code: If True, extracts base code (e.g., 'en' from 'en-US').
|
|
586
|
+
If False, uses full language code as-is.
|
|
587
|
+
|
|
588
|
+
Returns:
|
|
589
|
+
The resolved language code for the service.
|
|
590
|
+
|
|
591
|
+
Examples::
|
|
592
|
+
|
|
593
|
+
# Service expecting base codes (e.g., Cartesia)
|
|
594
|
+
>>> LANGUAGE_MAP = {Language.EN: "en", Language.ES: "es"}
|
|
595
|
+
>>> resolve_language(Language.EN_US, LANGUAGE_MAP, use_base_code=True)
|
|
596
|
+
# Logs: "Language en-US not verified. Using base code 'en'."
|
|
597
|
+
"en"
|
|
598
|
+
|
|
599
|
+
# Service expecting full codes (e.g., AWS)
|
|
600
|
+
>>> LANGUAGE_MAP = {Language.EN_US: "en-US", Language.ES_ES: "es-ES"}
|
|
601
|
+
>>> resolve_language(Language.EN_GB, LANGUAGE_MAP, use_base_code=False)
|
|
602
|
+
# Logs: "Language en-GB not verified. Using 'en-GB'."
|
|
603
|
+
"en-GB"
|
|
604
|
+
"""
|
|
605
|
+
# Check if language is in the verified map
|
|
606
|
+
result = language_map.get(language)
|
|
607
|
+
|
|
608
|
+
if result is not None:
|
|
609
|
+
return result
|
|
610
|
+
|
|
611
|
+
# Not in map - fall back with warning
|
|
612
|
+
lang_str = str(language.value)
|
|
613
|
+
|
|
614
|
+
if use_base_code:
|
|
615
|
+
# Extract base code (e.g., "en" from "en-US")
|
|
616
|
+
base_code = lang_str.split("-")[0].lower()
|
|
617
|
+
# logger.warning(f"Language {language.value} not verified. Using base code '{base_code}'.")
|
|
618
|
+
return base_code
|
|
619
|
+
else:
|
|
620
|
+
# logger.warning(f"Language {language.value} not verified. Using '{lang_str}'.")
|
|
621
|
+
return lang_str
|
|
File without changes
|
{dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{dv_pipecat_ai-0.0.85.dev854.dist-info → dv_pipecat_ai-0.0.85.dev856.dist-info}/top_level.txt
RENAMED
|
File without changes
|