mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-22 11:51:04 +02:00
chore: minor fixes
This commit is contained in:
parent
514d9c5238
commit
1f3b3e2e3c
6 changed files with 25 additions and 12 deletions
|
|
@ -122,7 +122,7 @@ GROQ_MODELS = [
|
||||||
"openai/gpt-oss-120b",
|
"openai/gpt-oss-120b",
|
||||||
]
|
]
|
||||||
AZURE_MODELS = ["gpt-4.1-mini"]
|
AZURE_MODELS = ["gpt-4.1-mini"]
|
||||||
DOGRAH_LLM_MODELS = ["default", "accurate", "fast", "lite", "zen", "zen_lite"]
|
DOGRAH_LLM_MODELS = ["default", "accurate", "fast", "lite", "zen"]
|
||||||
|
|
||||||
|
|
||||||
@register_llm
|
@register_llm
|
||||||
|
|
@ -266,9 +266,13 @@ SARVAM_LANGUAGES = [
|
||||||
@register_tts
|
@register_tts
|
||||||
class SarvamTTSConfiguration(BaseTTSConfiguration):
|
class SarvamTTSConfiguration(BaseTTSConfiguration):
|
||||||
provider: Literal[ServiceProviders.SARVAM] = ServiceProviders.SARVAM
|
provider: Literal[ServiceProviders.SARVAM] = ServiceProviders.SARVAM
|
||||||
model: str = Field(default="bulbul:v2", json_schema_extra={"examples": SARVAM_TTS_MODELS})
|
model: str = Field(
|
||||||
|
default="bulbul:v2", json_schema_extra={"examples": SARVAM_TTS_MODELS}
|
||||||
|
)
|
||||||
voice: str = Field(default="anushka", json_schema_extra={"examples": SARVAM_VOICES})
|
voice: str = Field(default="anushka", json_schema_extra={"examples": SARVAM_VOICES})
|
||||||
language: str = Field(default="hi-IN", json_schema_extra={"examples": SARVAM_LANGUAGES})
|
language: str = Field(
|
||||||
|
default="hi-IN", json_schema_extra={"examples": SARVAM_LANGUAGES}
|
||||||
|
)
|
||||||
api_key: str
|
api_key: str
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -372,8 +376,12 @@ SARVAM_STT_MODELS = ["saarika:v2.5", "saaras:v2"]
|
||||||
@register_stt
|
@register_stt
|
||||||
class SarvamSTTConfiguration(BaseSTTConfiguration):
|
class SarvamSTTConfiguration(BaseSTTConfiguration):
|
||||||
provider: Literal[ServiceProviders.SARVAM] = ServiceProviders.SARVAM
|
provider: Literal[ServiceProviders.SARVAM] = ServiceProviders.SARVAM
|
||||||
model: str = Field(default="saarika:v2.5", json_schema_extra={"examples": SARVAM_STT_MODELS})
|
model: str = Field(
|
||||||
language: str = Field(default="hi-IN", json_schema_extra={"examples": SARVAM_LANGUAGES})
|
default="saarika:v2.5", json_schema_extra={"examples": SARVAM_STT_MODELS}
|
||||||
|
)
|
||||||
|
language: str = Field(
|
||||||
|
default="hi-IN", json_schema_extra={"examples": SARVAM_LANGUAGES}
|
||||||
|
)
|
||||||
api_key: str
|
api_key: str
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ class LoopTalkPipelineBuilder:
|
||||||
# Create engine first (needed for create_pipeline_components)
|
# Create engine first (needed for create_pipeline_components)
|
||||||
engine = PipecatEngine(
|
engine = PipecatEngine(
|
||||||
llm=llm,
|
llm=llm,
|
||||||
tts=tts,
|
|
||||||
workflow=workflow_graph,
|
workflow=workflow_graph,
|
||||||
call_context_vars={},
|
call_context_vars={},
|
||||||
workflow_run_id=None, # LoopTalk doesn't have workflow runs
|
workflow_run_id=None, # LoopTalk doesn't have workflow runs
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,6 @@ async def _run_pipeline(
|
||||||
|
|
||||||
engine = PipecatEngine(
|
engine = PipecatEngine(
|
||||||
llm=llm,
|
llm=llm,
|
||||||
tts=tts,
|
|
||||||
workflow=workflow_graph,
|
workflow=workflow_graph,
|
||||||
call_context_vars=merged_call_context_vars,
|
call_context_vars=merged_call_context_vars,
|
||||||
workflow_run_id=workflow_run_id,
|
workflow_run_id=workflow_run_id,
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
def create_stt_service(user_config):
|
def create_stt_service(user_config):
|
||||||
"""Create and return appropriate STT service based on user configuration"""
|
"""Create and return appropriate STT service based on user configuration"""
|
||||||
|
logger.info(
|
||||||
|
f"Creating STT service: provider={user_config.stt.provider}, model={user_config.stt.model}"
|
||||||
|
)
|
||||||
if user_config.stt.provider == ServiceProviders.DEEPGRAM.value:
|
if user_config.stt.provider == ServiceProviders.DEEPGRAM.value:
|
||||||
# Use language from user config, defaulting to "multi" for multilingual support
|
# Use language from user config, defaulting to "multi" for multilingual support
|
||||||
language = getattr(user_config.stt, "language", None) or "multi"
|
language = getattr(user_config.stt, "language", None) or "multi"
|
||||||
|
|
@ -110,6 +113,9 @@ def create_tts_service(user_config, audio_config: "AudioConfig"):
|
||||||
user_config: User configuration containing TTS settings
|
user_config: User configuration containing TTS settings
|
||||||
transport_type: Type of transport (e.g., 'stasis', 'twilio', 'webrtc')
|
transport_type: Type of transport (e.g., 'stasis', 'twilio', 'webrtc')
|
||||||
"""
|
"""
|
||||||
|
logger.info(
|
||||||
|
f"Creating TTS service: provider={user_config.tts.provider}, model={user_config.tts.model}"
|
||||||
|
)
|
||||||
# Create function call filter to prevent TTS from speaking function call tags
|
# Create function call filter to prevent TTS from speaking function call tags
|
||||||
xml_function_tag_filter = XMLFunctionTagFilter()
|
xml_function_tag_filter = XMLFunctionTagFilter()
|
||||||
if user_config.tts.provider == ServiceProviders.DEEPGRAM.value:
|
if user_config.tts.provider == ServiceProviders.DEEPGRAM.value:
|
||||||
|
|
@ -186,6 +192,9 @@ def create_tts_service(user_config, audio_config: "AudioConfig"):
|
||||||
def create_llm_service(user_config):
|
def create_llm_service(user_config):
|
||||||
"""Create and return appropriate LLM service based on user configuration"""
|
"""Create and return appropriate LLM service based on user configuration"""
|
||||||
model = user_config.llm.model
|
model = user_config.llm.model
|
||||||
|
logger.info(
|
||||||
|
f"Creating LLM service: provider={user_config.llm.provider}, model={model}"
|
||||||
|
)
|
||||||
if user_config.llm.provider == ServiceProviders.OPENAI.value:
|
if user_config.llm.provider == ServiceProviders.OPENAI.value:
|
||||||
if "gpt-5" in model:
|
if "gpt-5" in model:
|
||||||
return OpenAILLMService(
|
return OpenAILLMService(
|
||||||
|
|
@ -251,6 +260,6 @@ def create_voicemail_classification_llm():
|
||||||
|
|
||||||
return OpenAILLMService(
|
return OpenAILLMService(
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
model="gpt-4o-mini",
|
model="gpt-4o",
|
||||||
params=OpenAILLMService.InputParams(temperature=0.0),
|
params=OpenAILLMService.InputParams(temperature=0.0),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Optional, Union
|
from typing import TYPE_CHECKING, Awaitable, Callable, Optional, Union
|
||||||
|
|
||||||
from api.services.workflow.disposition_mapper import (
|
from api.services.workflow.disposition_mapper import (
|
||||||
apply_disposition_mapping,
|
apply_disposition_mapping,
|
||||||
|
|
@ -57,7 +57,6 @@ class PipecatEngine:
|
||||||
task: Optional[PipelineTask] = None,
|
task: Optional[PipelineTask] = None,
|
||||||
llm: Optional["LLMService"] = None,
|
llm: Optional["LLMService"] = None,
|
||||||
context: Optional[LLMContext] = None,
|
context: Optional[LLMContext] = None,
|
||||||
tts: Optional[Any] = None,
|
|
||||||
transport: Optional[BaseTransport] = None,
|
transport: Optional[BaseTransport] = None,
|
||||||
workflow: WorkflowGraph,
|
workflow: WorkflowGraph,
|
||||||
call_context_vars: dict,
|
call_context_vars: dict,
|
||||||
|
|
@ -67,7 +66,6 @@ class PipecatEngine:
|
||||||
self.task = task
|
self.task = task
|
||||||
self.llm = llm
|
self.llm = llm
|
||||||
self.context = context
|
self.context = context
|
||||||
self.tts = tts
|
|
||||||
self.transport = transport
|
self.transport = transport
|
||||||
self.workflow = workflow
|
self.workflow = workflow
|
||||||
self._call_context_vars = call_context_vars
|
self._call_context_vars = call_context_vars
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ def create_user_idle_callback(engine: "PipecatEngine"):
|
||||||
|
|
||||||
message = {
|
message = {
|
||||||
"role": "system",
|
"role": "system",
|
||||||
"content": "The user has been quiet. We will be disconnecting the call now. Wish them a good day.",
|
"content": "The user has been quiet. We will be disconnecting the call now. Wish them a good day in the language that the user has been speaking so far.",
|
||||||
}
|
}
|
||||||
await user_idle.push_frame(LLMMessagesAppendFrame([message], run_llm=True))
|
await user_idle.push_frame(LLMMessagesAppendFrame([message], run_llm=True))
|
||||||
await engine.send_end_task_frame(
|
await engine.send_end_task_frame(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue