diff --git a/src/control_backend/agents/base.py b/src/control_backend/agents/base.py index c12c503..ec50af5 100644 --- a/src/control_backend/agents/base.py +++ b/src/control_backend/agents/base.py @@ -16,8 +16,11 @@ class BaseAgent(CoreBaseAgent): logger: logging.Logger - # Whenever a subclass is initiated, give it the correct logger def __init_subclass__(cls, **kwargs) -> None: + """ + Whenever a subclass is initiated, give it the correct logger. + :param kwargs: Keyword arguments for the subclass. + """ super().__init_subclass__(**kwargs) cls.logger = logging.getLogger(__package__).getChild(cls.__name__) diff --git a/src/control_backend/agents/communication/ri_communication_agent.py b/src/control_backend/agents/communication/ri_communication_agent.py index a57400e..f4e3ef0 100644 --- a/src/control_backend/agents/communication/ri_communication_agent.py +++ b/src/control_backend/agents/communication/ri_communication_agent.py @@ -189,6 +189,10 @@ class RICommunicationAgent(BaseAgent): self.logger.warning("Unhandled negotiation id: %s", id) async def stop(self): + """ + Closes all sockets. + :return: + """ if self._req_socket: self._req_socket.close() if self.pub_socket: diff --git a/src/control_backend/agents/llm/llm_instructions.py b/src/control_backend/agents/llm/llm_instructions.py index 40e52f4..753fab2 100644 --- a/src/control_backend/agents/llm/llm_instructions.py +++ b/src/control_backend/agents/llm/llm_instructions.py @@ -5,6 +5,8 @@ class LLMInstructions: It combines the base persona (Pepper robot) with dynamic norms and goals provided by the BDI system. + If no norms/goals are given it assumes empty lists. + :ivar norms: A list of behavioral norms. :ivar goals: A list of specific conversational goals. """ diff --git a/src/control_backend/agents/perception/vad_agent.py b/src/control_backend/agents/perception/vad_agent.py index 48ac741..948e4ec 100644 --- a/src/control_backend/agents/perception/vad_agent.py +++ b/src/control_backend/agents/perception/vad_agent.py @@ -141,6 +141,10 @@ class VADAgent(BaseAgent): await super().stop() def _connect_audio_in_socket(self): + """ + Connects (or binds) the socket for listening to audio from RI. + :return: + """ self.audio_in_socket = azmq.Context.instance().socket(zmq.SUB) self.audio_in_socket.setsockopt_string(zmq.SUBSCRIBE, "") if self.audio_in_bind: diff --git a/src/control_backend/logging/setup_logging.py b/src/control_backend/logging/setup_logging.py index 3d4808e..fe40738 100644 --- a/src/control_backend/logging/setup_logging.py +++ b/src/control_backend/logging/setup_logging.py @@ -37,6 +37,12 @@ def add_logging_level(level_name: str, level_num: int, method_name: str | None = def setup_logging(path: str = ".logging_config.yaml") -> None: + """ + Setup logging configuration of the CB. Tries to load the logging configuration from a file, + in which we specify custom loggers, formatters, handlers, etc. + :param path: + :return: + """ if os.path.exists(path): with open(path) as f: try: