feat: commit before I can merge new changes
ref: N25B-400
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
phase("9922935f-ec70-4792-9a61-37a129e1ec14").
|
||||
phase("0e0f239c-efe9-442c-bdd7-3aabfccd1c49").
|
||||
keyword_said(Keyword) :- (user_said(Message) & .substring(Keyword, Message, Pos)) & (Pos >= 0).
|
||||
|
||||
|
||||
@@ -19,20 +19,36 @@ keyword_said(Keyword) :- (user_said(Message) & .substring(Keyword, Message, Pos)
|
||||
.reply(Message, Norms).
|
||||
|
||||
+user_said(Message)
|
||||
: phase("9922935f-ec70-4792-9a61-37a129e1ec14")
|
||||
: phase("0e0f239c-efe9-442c-bdd7-3aabfccd1c49")
|
||||
<- .notify_user_said(Message);
|
||||
-responded_this_turn;
|
||||
!check_triggers;
|
||||
!transition_phase.
|
||||
|
||||
+!transition_phase
|
||||
: phase("9922935f-ec70-4792-9a61-37a129e1ec14") &
|
||||
: phase("0e0f239c-efe9-442c-bdd7-3aabfccd1c49") &
|
||||
not responded_this_turn
|
||||
<- -phase("9922935f-ec70-4792-9a61-37a129e1ec14");
|
||||
<- -phase("0e0f239c-efe9-442c-bdd7-3aabfccd1c49");
|
||||
+phase("1fc60869-86db-483d-b475-b8ecdec4bba8");
|
||||
?user_said(Message);
|
||||
-+user_said(Message);
|
||||
.notify_transition_phase("0e0f239c-efe9-442c-bdd7-3aabfccd1c49", "1fc60869-86db-483d-b475-b8ecdec4bba8").
|
||||
|
||||
+user_said(Message)
|
||||
: phase("1fc60869-86db-483d-b475-b8ecdec4bba8")
|
||||
<- .notify_user_said(Message);
|
||||
-responded_this_turn;
|
||||
!check_triggers;
|
||||
!transition_phase.
|
||||
|
||||
+!transition_phase
|
||||
: phase("1fc60869-86db-483d-b475-b8ecdec4bba8") &
|
||||
not responded_this_turn
|
||||
<- -phase("1fc60869-86db-483d-b475-b8ecdec4bba8");
|
||||
+phase("end");
|
||||
?user_said(Message);
|
||||
-+user_said(Message);
|
||||
.notify_transition_phase("9922935f-ec70-4792-9a61-37a129e1ec14", "end").
|
||||
.notify_transition_phase("1fc60869-86db-483d-b475-b8ecdec4bba8", "end").
|
||||
|
||||
+user_said(Message)
|
||||
: phase("end")
|
||||
|
||||
@@ -93,6 +93,7 @@ class BDIProgramManager(BaseAgent):
|
||||
thread="transition_phase",
|
||||
body=str(self._phase.id),
|
||||
)
|
||||
self.logger.info(f"Transitioned to phase {new}, notifying UserInterruptAgent.")
|
||||
|
||||
self.add_behavior(self.send(msg))
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class UserInterruptAgent(BaseAgent):
|
||||
self.pub_socket.connect(settings.zmq_settings.internal_pub_address)
|
||||
|
||||
self.add_behavior(self._receive_button_event())
|
||||
self.add_behavior(self.test_sending_behaviour())
|
||||
# self.add_behavior(self.test_sending_behaviour())
|
||||
|
||||
async def _receive_button_event(self):
|
||||
"""
|
||||
@@ -99,6 +99,23 @@ class UserInterruptAgent(BaseAgent):
|
||||
event_context,
|
||||
)
|
||||
|
||||
async def handle_message(self, msg: InternalMessage):
|
||||
"""
|
||||
Handle commands received from other internal Python agents.
|
||||
"""
|
||||
match msg.thread:
|
||||
case "transition_phase":
|
||||
new_phase_id = msg.body
|
||||
self.logger.info(f"Phase transition detected: {new_phase_id}")
|
||||
|
||||
payload = {"type": "phase_update", "phase_id": new_phase_id}
|
||||
|
||||
await self._send_experiment_update(payload)
|
||||
|
||||
case _:
|
||||
self.logger.debug(f"Received internal message on unhandled thread: {msg.thread}")
|
||||
|
||||
# moet weg!!!!!
|
||||
async def test_sending_behaviour(self):
|
||||
self.logger.info("Starting simple test sending behaviour...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user