Fix client side message handling

This commit is contained in:
2024-11-03 22:44:43 +01:00
parent e243c6ac3b
commit b4c70cd5b8
4 changed files with 7 additions and 10 deletions

View File

@@ -126,7 +126,7 @@ class WebAgent(BaseAgent):
self._set_state(WebAgentState.INFERENCE)
self.set_response("")
response_token_iter = self._llm.infer(self._system_prompt, self.context)
response_token_iter = self._llm.infer(f"{self._system_prompt}\n{self._action_schema}", self.context)
response = ""
for token in response_token_iter:
response += token

View File

@@ -86,11 +86,8 @@ class WebSocketManager:
})
async for msg in ws:
if msg.type == WSMsgType.TEXT:
#try:
data = json.loads(msg.data)
await self._handle_client_message(request, data)
#except Exception as e:
# print(f"Error handling incoming websocket message: {msg}\n{e}")
elif msg.type == WSMsgType.ERROR:
print(f"WebSocket connection closed with error: {ws.exception()}")
finally: