fix user implemented agent types

This commit is contained in:
Ajay Raj 2023-03-02 16:15:22 -08:00
commit 40a94f94be
2 changed files with 8 additions and 6 deletions

View file

@ -1,11 +1,11 @@
from vocode.user_implemented_agent.restful_agent import RESTfulAgent from vocode.user_implemented_agent.restful_agent import RESTfulAgent
from vocode.user_implemented_agent.websocket_agent import WebSocketAgent from vocode.user_implemented_agent.websocket_agent import WebSocketAgent
class EchoAgent(RESTfulAgent): class EchoAgent(WebSocketAgent):
async def respond(self, input: str) -> str: async def respond(self, input: str) -> str:
return input return input
if __name__ == "__main__": if __name__ == "__main__":
agent = EchoAgent() agent = EchoAgent()
agent.run() agent.run()

View file

@ -44,8 +44,9 @@ class RESTfulUserImplementedAgentConfig(AgentConfig, type=AgentType.RESTFUL_USER
method: str = "POST" method: str = "POST"
respond: EndpointConfig respond: EndpointConfig
generate_response: Optional[EndpointConfig] generate_responses: bool = False
update_last_bot_message_on_cut_off: Optional[EndpointConfig] # generate_response: Optional[EndpointConfig]
# update_last_bot_message_on_cut_off: Optional[EndpointConfig]
class RESTfulAgentInput(BaseModel): class RESTfulAgentInput(BaseModel):
human_input: str human_input: str
@ -58,8 +59,9 @@ class WebSocketUserImplementedAgentConfig(AgentConfig, type=AgentType.WEBSOCKET_
url: str url: str
respond: RouteConfig respond: RouteConfig
generate_response: Optional[RouteConfig] generate_responses: bool = False
send_message_on_cut_off: bool = False # generate_response: Optional[RouteConfig]
# send_message_on_cut_off: bool = False
class WebSocketAgentMessageType(str, Enum): class WebSocketAgentMessageType(str, Enum):
AGENT_BASE = 'agent_base' AGENT_BASE = 'agent_base'