Merge branch 'dev' into refactor/logging
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from spade.behaviour import CyclicBehaviour
|
||||
from spade.message import Message
|
||||
|
||||
from control_backend.core.config import settings
|
||||
from control_backend.schemas.ri_message import SpeechCommand
|
||||
|
||||
|
||||
class ReceiveLLMResponseBehaviour(CyclicBehaviour):
|
||||
@@ -16,7 +18,20 @@ class ReceiveLLMResponseBehaviour(CyclicBehaviour):
|
||||
case settings.agent_settings.llm_agent_name:
|
||||
content = msg.body
|
||||
self.agent.logger.info("Received LLM response: %s", content)
|
||||
# Here the BDI can pass the message back as a response
|
||||
|
||||
speech_command = SpeechCommand(data=content)
|
||||
|
||||
message = Message(
|
||||
to=settings.agent_settings.ri_command_agent_name
|
||||
+ "@"
|
||||
+ settings.agent_settings.host,
|
||||
sender=self.agent.jid,
|
||||
body=speech_command.model_dump_json(),
|
||||
)
|
||||
|
||||
self.agent.logger.debug("Sending message: %s", message)
|
||||
|
||||
await self.send(message)
|
||||
case _:
|
||||
self.agent.logger.debug("Discarding message from %s", sender)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user