mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-13 11:22:14 +02:00
chore: update pipecat submodule
This commit is contained in:
parent
7a102026fb
commit
4c8c9516dc
3 changed files with 19 additions and 10 deletions
|
|
@ -62,6 +62,7 @@ from pipecat.turns.user_mute import (
|
||||||
MuteUntilFirstBotCompleteUserMuteStrategy,
|
MuteUntilFirstBotCompleteUserMuteStrategy,
|
||||||
)
|
)
|
||||||
from pipecat.turns.user_start import (
|
from pipecat.turns.user_start import (
|
||||||
|
ExternalUserTurnStartStrategy,
|
||||||
TranscriptionUserTurnStartStrategy,
|
TranscriptionUserTurnStartStrategy,
|
||||||
)
|
)
|
||||||
from pipecat.turns.user_start.vad_user_turn_start_strategy import (
|
from pipecat.turns.user_start.vad_user_turn_start_strategy import (
|
||||||
|
|
@ -580,7 +581,10 @@ async def _run_pipeline(
|
||||||
|
|
||||||
if is_deepgram_flux:
|
if is_deepgram_flux:
|
||||||
user_turn_strategies = UserTurnStrategies(
|
user_turn_strategies = UserTurnStrategies(
|
||||||
start=[VADUserTurnStartStrategy(), TranscriptionUserTurnStartStrategy()],
|
start=[
|
||||||
|
VADUserTurnStartStrategy(),
|
||||||
|
ExternalUserTurnStartStrategy(enable_interruptions=True),
|
||||||
|
],
|
||||||
stop=[ExternalUserTurnStopStrategy()],
|
stop=[ExternalUserTurnStopStrategy()],
|
||||||
)
|
)
|
||||||
elif turn_stop_strategy == "turn_analyzer":
|
elif turn_stop_strategy == "turn_analyzer":
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ if TYPE_CHECKING:
|
||||||
from api.services.pipecat.audio_config import AudioConfig
|
from api.services.pipecat.audio_config import AudioConfig
|
||||||
|
|
||||||
|
|
||||||
def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[str] | None = None):
|
def create_stt_service(
|
||||||
|
user_config, audio_config: "AudioConfig", keyterms: list[str] | None = None
|
||||||
|
):
|
||||||
"""Create and return appropriate STT service based on user configuration
|
"""Create and return appropriate STT service based on user configuration
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
@ -53,7 +55,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[
|
||||||
keyterm=keyterms or [],
|
keyterm=keyterms or [],
|
||||||
),
|
),
|
||||||
should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame
|
should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame
|
||||||
sample_rate=audio_config.transport_in_sample_rate
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Other models than flux
|
# Other models than flux
|
||||||
|
|
@ -64,21 +66,24 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[
|
||||||
profanity_filter=False,
|
profanity_filter=False,
|
||||||
endpointing=100,
|
endpointing=100,
|
||||||
model=user_config.stt.model,
|
model=user_config.stt.model,
|
||||||
keyterm=keyterms or []
|
keyterm=keyterms or [],
|
||||||
)
|
)
|
||||||
logger.debug(f"Using DeepGram Model - {user_config.stt.model}")
|
logger.debug(f"Using DeepGram Model - {user_config.stt.model}")
|
||||||
return DeepgramSTTService(
|
return DeepgramSTTService(
|
||||||
live_options=live_options,
|
live_options=live_options,
|
||||||
api_key=user_config.stt.api_key,
|
api_key=user_config.stt.api_key,
|
||||||
should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame
|
should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame
|
||||||
sample_rate=audio_config.transport_in_sample_rate
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
)
|
)
|
||||||
elif user_config.stt.provider == ServiceProviders.OPENAI.value:
|
elif user_config.stt.provider == ServiceProviders.OPENAI.value:
|
||||||
return OpenAISTTService(
|
return OpenAISTTService(
|
||||||
api_key=user_config.stt.api_key, model=user_config.stt.model
|
api_key=user_config.stt.api_key, model=user_config.stt.model
|
||||||
)
|
)
|
||||||
elif user_config.stt.provider == ServiceProviders.CARTESIA.value:
|
elif user_config.stt.provider == ServiceProviders.CARTESIA.value:
|
||||||
return CartesiaSTTService(api_key=user_config.stt.api_key, sample_rate=audio_config.transport_in_sample_rate)
|
return CartesiaSTTService(
|
||||||
|
api_key=user_config.stt.api_key,
|
||||||
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
|
)
|
||||||
elif user_config.stt.provider == ServiceProviders.DOGRAH.value:
|
elif user_config.stt.provider == ServiceProviders.DOGRAH.value:
|
||||||
base_url = MPS_API_URL.replace("http://", "ws://").replace("https://", "wss://")
|
base_url = MPS_API_URL.replace("http://", "ws://").replace("https://", "wss://")
|
||||||
language = getattr(user_config.stt, "language", None) or "multi"
|
language = getattr(user_config.stt, "language", None) or "multi"
|
||||||
|
|
@ -88,7 +93,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[
|
||||||
model=user_config.stt.model,
|
model=user_config.stt.model,
|
||||||
language=language,
|
language=language,
|
||||||
keyterms=keyterms,
|
keyterms=keyterms,
|
||||||
sample_rate=audio_config.transport_in_sample_rate
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
)
|
)
|
||||||
elif user_config.stt.provider == ServiceProviders.SARVAM.value:
|
elif user_config.stt.provider == ServiceProviders.SARVAM.value:
|
||||||
# Map Sarvam language code to pipecat Language enum
|
# Map Sarvam language code to pipecat Language enum
|
||||||
|
|
@ -112,7 +117,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[
|
||||||
api_key=user_config.stt.api_key,
|
api_key=user_config.stt.api_key,
|
||||||
model=user_config.stt.model,
|
model=user_config.stt.model,
|
||||||
params=SarvamSTTService.InputParams(language=pipecat_language),
|
params=SarvamSTTService.InputParams(language=pipecat_language),
|
||||||
sample_rate=audio_config.transport_in_sample_rate
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
)
|
)
|
||||||
elif user_config.stt.provider == ServiceProviders.SPEECHMATICS.value:
|
elif user_config.stt.provider == ServiceProviders.SPEECHMATICS.value:
|
||||||
from pipecat.services.speechmatics.stt import (
|
from pipecat.services.speechmatics.stt import (
|
||||||
|
|
@ -138,7 +143,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[
|
||||||
operating_point=operating_point,
|
operating_point=operating_point,
|
||||||
additional_vocab=additional_vocab,
|
additional_vocab=additional_vocab,
|
||||||
),
|
),
|
||||||
sample_rate=audio_config.transport_in_sample_rate
|
sample_rate=audio_config.transport_in_sample_rate,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
|
||||||
2
pipecat
2
pipecat
|
|
@ -1 +1 @@
|
||||||
Subproject commit d67983b3b165f945a93e5ce594f47781a96bff9b
|
Subproject commit 3de34e0c4bb2e5d5b564ae801ba276eeb9f3fcdb
|
||||||
Loading…
Add table
Add a link
Reference in a new issue