Planner configer
PlannerConfiger
¶
Bases: ComponentConfiger
The PlannerConfiger class, which is used to load and manage the Planner configuration.
Source code in agentuniverse/base/config/component_configer/configers/planner_configer.py
Python
class PlannerConfiger(ComponentConfiger):
"""The PlannerConfiger class, which is used to load and manage the Planner configuration."""
def __init__(self, configer: Optional[Configer] = None):
"""Initialize the PlannerConfiger."""
super().__init__(configer)
self.__name: Optional[str] = None
self.__description: Optional[str] = None
self.__input_key: Optional[str] = None
self.__output_key: Optional[str] = None
self.__memory_key: Optional[str] = None
@property
def input_key(self) -> Optional[str]:
"""Return the input key of the Planner."""
return self.__input_key
@property
def output_key(self) -> Optional[str]:
"""Return the output key of the Planner."""
return self.__output_key
@property
def memory_key(self) -> Optional[str]:
"""Return the memory key of the Planner."""
return self.__memory_key
@property
def name(self) -> Optional[str]:
"""Return the name of the Planner."""
return self.__name
@property
def description(self) -> Optional[str]:
"""Return the description of the Planner."""
return self.__description
def load(self) -> 'PlannerConfiger':
"""Load the configuration by the Configer object.
Returns:
PlannerConfiger: the PlannerConfiger object
"""
return self.load_by_configer(self.__configer)
def load_by_configer(self, configer: Configer) -> 'PlannerConfiger':
"""Load the configuration by the Configer object.
Args:
configer(Configer): the Configer object
Returns:
PlannerConfiger: the PlannerConfiger object
"""
super().load_by_configer(configer)
try:
self.__name = configer.value.get('name')
self.__description = configer.value.get('description')
except Exception as e:
raise Exception(f"Failed to parse the Planner configuration: {e}")
return self
description: Optional[str]
property
¶
Return the description of the Planner.
input_key: Optional[str]
property
¶
Return the input key of the Planner.
memory_key: Optional[str]
property
¶
Return the memory key of the Planner.
name: Optional[str]
property
¶
Return the name of the Planner.
output_key: Optional[str]
property
¶
Return the output key of the Planner.
__init__(configer=None)
¶
Initialize the PlannerConfiger.
Source code in agentuniverse/base/config/component_configer/configers/planner_configer.py
Python
def __init__(self, configer: Optional[Configer] = None):
"""Initialize the PlannerConfiger."""
super().__init__(configer)
self.__name: Optional[str] = None
self.__description: Optional[str] = None
self.__input_key: Optional[str] = None
self.__output_key: Optional[str] = None
self.__memory_key: Optional[str] = None
load()
¶
Load the configuration by the Configer object. Returns: PlannerConfiger: the PlannerConfiger object
load_by_configer(configer)
¶
Load the configuration by the Configer object. Args: configer(Configer): the Configer object Returns: PlannerConfiger: the PlannerConfiger object
Source code in agentuniverse/base/config/component_configer/configers/planner_configer.py
Python
def load_by_configer(self, configer: Configer) -> 'PlannerConfiger':
"""Load the configuration by the Configer object.
Args:
configer(Configer): the Configer object
Returns:
PlannerConfiger: the PlannerConfiger object
"""
super().load_by_configer(configer)
try:
self.__name = configer.value.get('name')
self.__description = configer.value.get('description')
except Exception as e:
raise Exception(f"Failed to parse the Planner configuration: {e}")
return self