Compare commits
1 Commits
main
...
fix/none-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b785493b97 |
@@ -17,7 +17,9 @@ class BeliefSetterBehaviour(CyclicBehaviour):
|
|||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""Polls for messages and processes them."""
|
"""Polls for messages and processes them."""
|
||||||
msg = await self.receive()
|
msg = await self.receive(timeout=1)
|
||||||
|
if not msg:
|
||||||
|
return
|
||||||
self.agent.logger.debug(
|
self.agent.logger.debug(
|
||||||
"Received message from %s with thread '%s' and body: %s",
|
"Received message from %s with thread '%s' and body: %s",
|
||||||
msg.sender,
|
msg.sender,
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ class ReceiveLLMResponseBehaviour(CyclicBehaviour):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
msg = await self.receive()
|
msg = await self.receive(timeout=1)
|
||||||
|
if not msg:
|
||||||
|
return
|
||||||
|
|
||||||
sender = msg.sender.node
|
sender = msg.sender.node
|
||||||
match sender:
|
match sender:
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class BeliefFromText(CyclicBehaviour):
|
|||||||
beliefs = {"mood": ["X"], "car": ["Y"]}
|
beliefs = {"mood": ["X"], "car": ["Y"]}
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
msg = await self.receive()
|
msg = await self.receive(timeout=1)
|
||||||
if msg is None:
|
if not msg:
|
||||||
return
|
return
|
||||||
|
|
||||||
sender = msg.sender.node
|
sender = msg.sender.node
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ class ContinuousBeliefCollector(CyclicBehaviour):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
msg = await self.receive()
|
msg = await self.receive(timeout=1)
|
||||||
|
if not msg:
|
||||||
|
return
|
||||||
await self._process_message(msg)
|
await self._process_message(msg)
|
||||||
|
|
||||||
async def _process_message(self, msg: Message):
|
async def _process_message(self, msg: Message):
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ class LLMAgent(BaseAgent):
|
|||||||
Receives SPADE messages and processes only those originating from the
|
Receives SPADE messages and processes only those originating from the
|
||||||
configured BDI agent.
|
configured BDI agent.
|
||||||
"""
|
"""
|
||||||
msg = await self.receive()
|
msg = await self.receive(timeout=1)
|
||||||
|
if not msg:
|
||||||
|
return
|
||||||
|
|
||||||
sender = msg.sender.node
|
sender = msg.sender.node
|
||||||
self.agent.logger.debug(
|
self.agent.logger.debug(
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ class RICommandAgent(BaseAgent):
|
|||||||
"""Behaviour for sending commands received from other Python agents."""
|
"""Behaviour for sending commands received from other Python agents."""
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
message: spade.agent.Message = await self.receive(timeout=0.1)
|
message: spade.agent.Message = await self.receive(timeout=1)
|
||||||
|
if not message:
|
||||||
|
return
|
||||||
if message and message.to == self.agent.jid:
|
if message and message.to == self.agent.jid:
|
||||||
try:
|
try:
|
||||||
speech_command = SpeechCommand.model_validate_json(message.body)
|
speech_command = SpeechCommand.model_validate_json(message.body)
|
||||||
|
|||||||
Reference in New Issue
Block a user