mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-19 11:41:04 +02:00
fix: add Transcription Turn Start for non external STTs (#559)
This commit is contained in:
parent
f635abb312
commit
104dc56706
5 changed files with 13 additions and 19 deletions
|
|
@ -52,16 +52,6 @@ class AudioConfig:
|
|||
)
|
||||
self.pipeline_sample_rate = 16000
|
||||
|
||||
# Log configuration for auditing
|
||||
logger.info(
|
||||
f"AudioConfig initialized: "
|
||||
f"transport_in={self.transport_in_sample_rate}Hz, "
|
||||
f"transport_out={self.transport_out_sample_rate}Hz, "
|
||||
f"vad={self.vad_sample_rate}Hz, "
|
||||
f"pipeline={self.pipeline_sample_rate}Hz, "
|
||||
f"buffer={self.buffer_size_seconds}s"
|
||||
)
|
||||
|
||||
@property
|
||||
def buffer_size_bytes(self) -> int:
|
||||
"""Calculate buffer size in bytes based on pipeline sample rate."""
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ from pipecat.turns.user_start import (
|
|||
MinWordsUserTurnStartStrategy,
|
||||
ProvisionalVADUserTurnStartStrategy,
|
||||
)
|
||||
from pipecat.turns.user_start.transcription_user_turn_start_strategy import (
|
||||
TranscriptionUserTurnStartStrategy,
|
||||
)
|
||||
from pipecat.turns.user_start.vad_user_turn_start_strategy import (
|
||||
VADUserTurnStartStrategy,
|
||||
)
|
||||
|
|
@ -160,9 +163,10 @@ def _create_non_realtime_user_turn_start_strategies(
|
|||
|
||||
if turn_start_strategy == "provisional_vad":
|
||||
return [
|
||||
TranscriptionUserTurnStartStrategy(),
|
||||
ProvisionalVADUserTurnStartStrategy(
|
||||
pause_secs=_resolve_provisional_vad_pause_secs(run_configs)
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
if uses_external_turns:
|
||||
|
|
@ -172,7 +176,7 @@ def _create_non_realtime_user_turn_start_strategies(
|
|||
# confirms a real turn.
|
||||
return [ExternalUserTurnStartStrategy(enable_interruptions=True)]
|
||||
|
||||
return [VADUserTurnStartStrategy()]
|
||||
return [TranscriptionUserTurnStartStrategy(), VADUserTurnStartStrategy()]
|
||||
|
||||
|
||||
def _create_non_realtime_user_turn_stop_strategies(
|
||||
|
|
|
|||
|
|
@ -227,7 +227,6 @@ def create_stt_service(
|
|||
# Other models than flux
|
||||
# Use language from user config, defaulting to "multi" for multilingual support
|
||||
language = getattr(user_config.stt, "language", None) or "multi"
|
||||
logger.debug(f"Using DeepGram Model - {user_config.stt.model}")
|
||||
return DeepgramSTTService(
|
||||
api_key=user_config.stt.api_key,
|
||||
settings=DeepgramSTTSettings(
|
||||
|
|
|
|||
|
|
@ -1111,9 +1111,7 @@ class CloudonixProvider(TelephonyProvider):
|
|||
from_number = random.choice(self.from_numbers)
|
||||
|
||||
backend_endpoint, _ = await get_backend_endpoints()
|
||||
callback_url = (
|
||||
f"{backend_endpoint}/api/v1/telephony/cloudonix/transfer-result/{transfer_id}"
|
||||
)
|
||||
callback_url = f"{backend_endpoint}/api/v1/telephony/cloudonix/transfer-result/{transfer_id}"
|
||||
|
||||
endpoint = f"{self.base_url}/calls/{self.domain_id}/application"
|
||||
data: Dict[str, Any] = {
|
||||
|
|
@ -1126,9 +1124,7 @@ class CloudonixProvider(TelephonyProvider):
|
|||
|
||||
data.update(kwargs)
|
||||
headers = self._get_auth_headers()
|
||||
masked_destination = (
|
||||
f"***{destination[-4:]}" if len(destination) > 4 else "***"
|
||||
)
|
||||
masked_destination = f"***{destination[-4:]}" if len(destination) > 4 else "***"
|
||||
logger.info(
|
||||
f"[Cloudonix Transfer] Dialing {masked_destination} into conference "
|
||||
f"{conference_name} (transfer_id={transfer_id})"
|
||||
|
|
|
|||
|
|
@ -647,6 +647,11 @@ function GeneralSection({
|
|||
</Select>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{selectedTurnStartStrategy?.description}
|
||||
{turnStartStrategy === "provisional_vad" && (
|
||||
<span className="ml-2 inline-flex rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground">
|
||||
Experimental
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
{turnStartStrategy === "min_words" && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue