monster commit
This commit is contained in:
parent
89d4dc2370
commit
de6d76c955
14 changed files with 155 additions and 66 deletions
|
|
@ -4,14 +4,14 @@ from .model import TypedModel, BaseModel
|
|||
|
||||
|
||||
class AgentType(str, Enum):
|
||||
BASE = "base"
|
||||
LLM = "llm"
|
||||
CHAT_GPT_ALPHA = "chat_gpt_alpha"
|
||||
CHAT_GPT = "chat_gpt"
|
||||
ECHO = "echo"
|
||||
INFORMATION_RETRIEVAL = "information_retrieval"
|
||||
RESTFUL_USER_IMPLEMENTED = "restful_user_implemented"
|
||||
WEBSOCKET_USER_IMPLEMENTED = "websocket_user_implemented"
|
||||
BASE = "agent_base"
|
||||
LLM = "agent_llm"
|
||||
CHAT_GPT_ALPHA = "agent_chat_gpt_alpha"
|
||||
CHAT_GPT = "agent_chat_gpt"
|
||||
ECHO = "agent_echo"
|
||||
INFORMATION_RETRIEVAL = "agent_information_retrieval"
|
||||
RESTFUL_USER_IMPLEMENTED = "agent_restful_user_implemented"
|
||||
WEBSOCKET_USER_IMPLEMENTED = "agent_websocket_user_implemented"
|
||||
|
||||
|
||||
class AgentConfig(TypedModel, type=AgentType.BASE):
|
||||
|
|
@ -57,9 +57,20 @@ class RESTfulUserImplementedAgentConfig(AgentConfig, type=AgentType.RESTFUL_USER
|
|||
class RESTfulAgentInput(BaseModel):
|
||||
human_input: str
|
||||
|
||||
class RESTfulAgentOutput(BaseModel):
|
||||
class RESTfulAgentOutputType(str, Enum):
|
||||
BASE = "restful_agent_base"
|
||||
TEXT = "restful_agent_text"
|
||||
END = "restful_agent_end"
|
||||
|
||||
class RESTfulAgentOutput(TypedModel, type=RESTfulAgentOutputType.BASE):
|
||||
pass
|
||||
|
||||
class RESTfulAgentText(RESTfulAgentOutput, type=RESTfulAgentOutputType.TEXT):
|
||||
response: str
|
||||
|
||||
class RESTfulAgentEnd(RESTfulAgentOutput, type=RESTfulAgentOutputType.END):
|
||||
pass
|
||||
|
||||
class WebSocketUserImplementedAgentConfig(AgentConfig, type=AgentType.WEBSOCKET_USER_IMPLEMENTED):
|
||||
class RouteConfig(BaseModel):
|
||||
url: str
|
||||
|
|
@ -70,15 +81,15 @@ class WebSocketUserImplementedAgentConfig(AgentConfig, type=AgentType.WEBSOCKET_
|
|||
# send_message_on_cut_off: bool = False
|
||||
|
||||
class WebSocketAgentMessageType(str, Enum):
|
||||
AGENT_BASE = 'agent_base'
|
||||
AGENT_START = 'agent_start'
|
||||
AGENT_TEXT = 'agent_text'
|
||||
AGENT_READY = 'agent_ready'
|
||||
AGENT_STOP = 'agent_stop'
|
||||
BASE = 'websocket_agent_base'
|
||||
START = 'websocket_agent_start'
|
||||
TEXT = 'websocket_agent_text'
|
||||
READY = 'websocket_agent_ready'
|
||||
STOP = 'websocket_agent_stop'
|
||||
|
||||
class WebSocketAgentMessage(TypedModel, type=WebSocketAgentMessageType.AGENT_BASE): pass
|
||||
class WebSocketAgentMessage(TypedModel, type=WebSocketAgentMessageType.BASE): pass
|
||||
|
||||
class AgentTextMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.AGENT_TEXT):
|
||||
class WebSocketAgentTextMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.TEXT):
|
||||
class Payload(BaseModel):
|
||||
text: str
|
||||
|
||||
|
|
@ -89,11 +100,11 @@ class AgentTextMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.AGE
|
|||
return cls(data=cls.Payload(text=text))
|
||||
|
||||
|
||||
class AgentStartMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.AGENT_START):
|
||||
class WebSocketAgentStartMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.START):
|
||||
pass
|
||||
|
||||
class AgentReadyMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.AGENT_READY):
|
||||
class WebSocketAgentReadyMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.READY):
|
||||
pass
|
||||
|
||||
class AgentStopMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.AGENT_STOP):
|
||||
class WebSocketAgentStopMessage(WebSocketAgentMessage, type=WebSocketAgentMessageType.STOP):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ from .audio_encoding import AudioEncoding
|
|||
from ..output_device.base_output_device import BaseOutputDevice
|
||||
|
||||
class SynthesizerType(str, Enum):
|
||||
BASE = "base"
|
||||
AZURE = "azure"
|
||||
GOOGLE = "google"
|
||||
ELEVEN_LABS = "eleven_labs"
|
||||
BASE = "synthesizer_base"
|
||||
AZURE = "synthesizer_azure"
|
||||
GOOGLE = "synthesizer_google"
|
||||
ELEVEN_LABS = "synthesizer_eleven_labs"
|
||||
|
||||
class SynthesizerConfig(TypedModel, type=SynthesizerType.BASE):
|
||||
sampling_rate: int
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
from pydantic import BaseModel
|
||||
from vocode.models.model import BaseModel
|
||||
from vocode.models.agent import AgentConfig, InformationRetrievalAgentConfig
|
||||
|
||||
|
||||
class CallEntity(BaseModel):
|
||||
phone_number: str
|
||||
descriptor: str
|
||||
|
||||
|
||||
class CreateCallRequest(BaseModel):
|
||||
recipient: CallEntity
|
||||
caller: CallEntity
|
||||
agent_config: InformationRetrievalAgentConfig # TODO switch to AgentConfig
|
||||
agent_config: AgentConfig
|
||||
# TODO add IVR/etc.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ from ..input_device.base_input_device import BaseInputDevice
|
|||
|
||||
|
||||
class TranscriberType(str, Enum):
|
||||
BASE = "base"
|
||||
DEEPGRAM = "deepgram"
|
||||
GOOGLE = "google"
|
||||
ASSEMBLY_AI = "assembly_ai"
|
||||
BASE = "transcriber_base"
|
||||
DEEPGRAM = "transcriber_deepgram"
|
||||
GOOGLE = "transcriber_google"
|
||||
ASSEMBLY_AI = "transcriber_assembly_ai"
|
||||
|
||||
|
||||
class EndpointingConfig(BaseModel):
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ from .agent import AgentConfig
|
|||
from .synthesizer import SynthesizerConfig
|
||||
|
||||
class WebSocketMessageType(str, Enum):
|
||||
BASE = 'base'
|
||||
START = 'start'
|
||||
AUDIO = 'audio'
|
||||
READY = 'ready'
|
||||
STOP = 'stop'
|
||||
BASE = 'websocket_base'
|
||||
START = 'websocket_start'
|
||||
AUDIO = 'websocket_audio'
|
||||
READY = 'websocket_ready'
|
||||
STOP = 'websocket_stop'
|
||||
|
||||
class WebSocketMessage(TypedModel, type=WebSocketMessageType.BASE): pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue