refactor: improve logging and module structure

Changed some folders to not be modules and organized some `__init__.py`
files.

ref: N25B-223
This commit is contained in:
2025-11-02 11:32:21 +01:00
parent d66fe07438
commit d43cb9394a
18 changed files with 179 additions and 154 deletions

View File

@@ -11,7 +11,7 @@ from spade.agent import Agent
from spade.behaviour import CyclicBehaviour
from spade.message import Message
from control_backend.agents.llm.llm_instructions import LLMInstructions
from .llm_instructions import LLMInstructions
from control_backend.core.config import settings
@@ -35,12 +35,10 @@ class LLMAgent(Agent):
Receives SPADE messages and processes only those originating from the
configured BDI agent.
"""
msg = await self.receive(timeout=1)
if not msg:
return
msg = await self.receive()
sender = msg.sender.node
self.agent.logger.info(
self.agent.logger.debug(
"Received message: %s from %s",
msg.body,
sender,
@@ -121,7 +119,6 @@ class LLMAgent(Agent):
Sets up the SPADE behaviour to filter and process messages from the
BDI Core Agent.
"""
self.logger.info("LLMAgent setup complete")
behaviour = self.ReceiveMessageBehaviour()
self.add_behaviour(behaviour)
self.logger.info("LLMAgent setup complete")