add voice configs + transcriber configs
This commit is contained in:
parent
68a51e7131
commit
1807fbef0d
6 changed files with 62 additions and 12 deletions
|
|
@ -1,9 +1,11 @@
|
|||
from typing import Optional
|
||||
from typing import Optional, Union
|
||||
from enum import Enum
|
||||
|
||||
from vocode.models.message import BaseMessage
|
||||
from .model import TypedModel, BaseModel
|
||||
|
||||
FILLER_AUDIO_DEFAULT_SILENCE_THRESHOLD_SECONDS = 0.5
|
||||
|
||||
|
||||
class AgentType(str, Enum):
|
||||
BASE = "agent_base"
|
||||
|
|
@ -16,11 +18,16 @@ class AgentType(str, Enum):
|
|||
WEBSOCKET_USER_IMPLEMENTED = "agent_websocket_user_implemented"
|
||||
|
||||
|
||||
class FillerAudioConfig(BaseModel):
|
||||
silence_threshold_seconds: float = FILLER_AUDIO_DEFAULT_SILENCE_THRESHOLD_SECONDS
|
||||
|
||||
|
||||
class AgentConfig(TypedModel, type=AgentType.BASE):
|
||||
initial_message: Optional[BaseMessage] = None
|
||||
generate_responses: bool = True
|
||||
allowed_idle_time_seconds: Optional[float] = None
|
||||
end_conversation_on_goodbye: bool = False
|
||||
send_filler_audio: Union[bool, FillerAudioConfig] = False
|
||||
|
||||
|
||||
class LLMAgentConfig(AgentConfig, type=AgentType.LLM):
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from typing import Optional
|
|||
from vocode.models.model import BaseModel
|
||||
from vocode.models.agent import AgentConfig
|
||||
from vocode.models.synthesizer import SynthesizerConfig
|
||||
from vocode.models.transcriber import TranscriberConfig
|
||||
|
||||
|
||||
class CallEntity(BaseModel):
|
||||
|
|
@ -9,7 +10,9 @@ class CallEntity(BaseModel):
|
|||
|
||||
|
||||
class CreateInboundCall(BaseModel):
|
||||
transcriber_config: Optional[TranscriberConfig] = None
|
||||
agent_config: AgentConfig
|
||||
synthesizer_config: Optional[SynthesizerConfig] = None
|
||||
twilio_sid: str
|
||||
conversation_id: Optional[str] = None
|
||||
|
||||
|
|
@ -17,6 +20,7 @@ class CreateInboundCall(BaseModel):
|
|||
class CreateOutboundCall(BaseModel):
|
||||
recipient: CallEntity
|
||||
caller: CallEntity
|
||||
transcriber_config: Optional[TranscriberConfig] = None
|
||||
agent_config: AgentConfig
|
||||
synthesizer_config: Optional[SynthesizerConfig] = None
|
||||
conversation_id: Optional[str] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue