Merge new implementation of robot ri api with unit tests into dev. #6

Merged
9828273 merged 39 commits from feat/cb2ui-robot-connections into dev 2025-10-28 13:49:41 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 149d20e77b - Show all commits

View File

@@ -32,11 +32,11 @@ class RICommandAgent(Agent):
# Try to get body # Try to get body
try: try:
body = json.loads(body)
message = SpeechCommand.model_validate(body) message = SpeechCommand.model_validate(body)
# Send to the robot. # Send to the robot.
await self.agent.pubsocket.send_json(message) await self.agent.pubsocket.send_json(message.model_dump())
except Exception as e: except Exception as e:
logger.error("Error processing message: %s", e) logger.error("Error processing message: %s", e)

View File

@@ -15,6 +15,6 @@ async def receive_command(command: SpeechCommand, request: Request):
SpeechCommand.model_validate(command) SpeechCommand.model_validate(command)
topic = b"command" topic = b"command"
pub_socket: Socket = request.app.state.internal_comm_socket pub_socket: Socket = request.app.state.internal_comm_socket
pub_socket.send_multipart([topic, command]) pub_socket.send_multipart([topic, command.model_dump_json().encode()])
return {"status": "Command received"} return {"status": "Command received"}