chore: automatically send the experiment controls to the bdi core in the user interupt agent.

This commit is contained in:
Björn Otgaar
2026-01-07 15:07:33 +01:00
parent 324a63e5cc
commit 34afca6652

View File

@@ -72,14 +72,8 @@ class UserInterruptAgent(BaseAgent):
event_context,
)
elif event_type == "next_phase":
_ = 1
elif event_type == "reset_phase":
_ = 1
elif event_type == " reset_experiment":
_ = 1
elif event_type in ["next_phase", "reset_phase", "reset_experiment"]:
await self._send_experiment_control_to_bdi_core(event_type)
else:
self.logger.warning(
@@ -89,12 +83,33 @@ class UserInterruptAgent(BaseAgent):
)
async def _send_experiment_control_to_bdi_core(self, type):
"""
method to send experiment control buttons to bdi core.
:param type: the type of control button we should send to the bdi core.
"""
# Switch which thread we should send to bdi core
thread = ""
match type:
case "next_phase":
thread = "force_next_phase"
case "reset_phase":
thread = "reset_current_phase"
case "reset_experiment":
thread = "reset_experiment"
case _:
self.logger.warning(
"Received unknown experiment control type '%s' to send to BDI Core.",
type,
)
out_msg = InternalMessage(
to=settings.agent_settings.bdi_core_name,
sender=self.name,
thread=type,
thread=thread,
body="",
)
self.logger.debug("Sending experiment control '%s' to BDI Core.", thread)
await self.send(out_msg)
async def _send_to_speech_agent(self, text_to_say: str):