feat: implemented pausing, implemented graceful stopping, removed old RI pausing code

ref: N25B-393
This commit is contained in:
Storm
2026-01-20 18:53:24 +01:00
parent f9b807fc97
commit 0b1c2ce20a
3 changed files with 52 additions and 30 deletions

View File

@@ -378,34 +378,29 @@ class UserInterruptAgent(BaseAgent):
self.logger.debug("Sending experiment control '%s' to BDI Core.", thread)
await self.send(out_msg)
async def _send_pause_command(self, pause):
async def _send_pause_command(self, pause: str):
"""
Send a pause command to the Robot Interface via the RI Communication Agent.
Send a pause command to the other internal agents; for now just VAD agent.
Send a pause command to the other internal agents; for now just VAD and VED agent.
"""
cmd = PauseCommand(data=pause)
message = InternalMessage(
to=settings.agent_settings.ri_communication_name,
sender=self.name,
body=cmd.model_dump_json(),
)
await self.send(message)
if pause == "true":
# Send pause to VAD agent
# Send pause to VAD and VED agent
vad_message = InternalMessage(
to=settings.agent_settings.vad_name,
to=[settings.agent_settings.vad_name,
settings.agent_settings.visual_emotion_recognition_name],
sender=self.name,
body="PAUSE",
)
await self.send(vad_message)
self.logger.info("Sent pause command to VAD Agent and RI Communication Agent.")
# Voice Activity Detection and Visual Emotion Recognition agents
self.logger.info("Sent pause command to VAD and VED agents.")
else:
# Send resume to VAD agent
# Send resume to VAD and VED agents
vad_message = InternalMessage(
to=settings.agent_settings.vad_name,
to=[settings.agent_settings.vad_name,
settings.agent_settings.visual_emotion_recognition_name],
sender=self.name,
body="RESUME",
)
await self.send(vad_message)
self.logger.info("Sent resume command to VAD Agent and RI Communication Agent.")
# Voice Activity Detection and Visual Emotion Recognition agents
self.logger.info("Sent resume command to VAD and VED agents.")