Add documentation #31
@@ -16,8 +16,11 @@ class BaseAgent(CoreBaseAgent):
|
|||||||
|
|
||||||
logger: logging.Logger
|
logger: logging.Logger
|
||||||
|
|
||||||
# Whenever a subclass is initiated, give it the correct logger
|
|
||||||
def __init_subclass__(cls, **kwargs) -> None:
|
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)
|
super().__init_subclass__(**kwargs)
|
||||||
|
|
||||||
cls.logger = logging.getLogger(__package__).getChild(cls.__name__)
|
cls.logger = logging.getLogger(__package__).getChild(cls.__name__)
|
||||||
|
|||||||
@@ -189,6 +189,10 @@ class RICommunicationAgent(BaseAgent):
|
|||||||
self.logger.warning("Unhandled negotiation id: %s", id)
|
self.logger.warning("Unhandled negotiation id: %s", id)
|
||||||
|
|
||||||
async def stop(self):
|
async def stop(self):
|
||||||
|
"""
|
||||||
|
Closes all sockets.
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
if self._req_socket:
|
if self._req_socket:
|
||||||
self._req_socket.close()
|
self._req_socket.close()
|
||||||
if self.pub_socket:
|
if self.pub_socket:
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ class LLMInstructions:
|
|||||||
It combines the base persona (Pepper robot) with dynamic norms and goals
|
It combines the base persona (Pepper robot) with dynamic norms and goals
|
||||||
provided by the BDI system.
|
provided by the BDI system.
|
||||||
|
|
||||||
|
If no norms/goals are given it assumes empty lists.
|
||||||
|
|
||||||
:ivar norms: A list of behavioral norms.
|
:ivar norms: A list of behavioral norms.
|
||||||
:ivar goals: A list of specific conversational goals.
|
:ivar goals: A list of specific conversational goals.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -141,6 +141,10 @@ class VADAgent(BaseAgent):
|
|||||||
await super().stop()
|
await super().stop()
|
||||||
|
|
||||||
def _connect_audio_in_socket(self):
|
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 = azmq.Context.instance().socket(zmq.SUB)
|
||||||
self.audio_in_socket.setsockopt_string(zmq.SUBSCRIBE, "")
|
self.audio_in_socket.setsockopt_string(zmq.SUBSCRIBE, "")
|
||||||
if self.audio_in_bind:
|
if self.audio_in_bind:
|
||||||
|
|||||||
@@ -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:
|
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):
|
if os.path.exists(path):
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user