aea.configurations.loader
Implementation of the parser for configuration file.
BaseConfigLoader Objects
class BaseConfigLoader()
Base class for configuration loader classes.
__
init__
| __init__(schema_filename: str)
Initialize the parser for configuration files.
Arguments:
schema_filename
: the path to the JSON-schema file in 'aea/configurations/schemas'.
validator
| @property
| validator() -> ConfigValidator
Get the json schema validator.
validate
| validate(json_data: Dict) -> None
Validate a JSON object.
Arguments:
json_data
: the JSON data.
Returns:
None.
required_
fields
| @property
| required_fields() -> List[str]
Get the required fields.
Returns:
list of required fields.
ConfigLoader Objects
class ConfigLoader(Generic[T], BaseConfigLoader)
Parsing, serialization and validation for package configuration files.
__
init__
| __init__(schema_filename: str, configuration_class: Type[T])
Initialize the parser for configuration files.
Arguments:
schema_filename
: the path to the JSON-schema file in 'aea/configurations/schemas'.configuration_class
: the configuration class (e.g. AgentConfig, SkillConfig etc.)
configuration_
class
| @property
| configuration_class() -> Type[T]
Get the configuration class of the loader.
load_
protocol_
specification
| load_protocol_specification(file_pointer: TextIO) -> T
Load an agent configuration file.
Arguments:
file_pointer
: the file pointer to the configuration file
Returns:
the configuration object. :raises
load
| load(file_pointer: TextIO) -> T
Load a configuration file.
Arguments:
file_pointer
: the file pointer to the configuration file
Returns:
the configuration object.
dump
| dump(configuration: T, file_pointer: TextIO) -> None
Dump a configuration.
Arguments:
configuration
: the configuration to be dumped.file_pointer
: the file pointer to the configuration file
Returns:
None
from_
configuration_
type
| @classmethod
| from_configuration_type(cls, configuration_type: Union[PackageType, str]) -> "ConfigLoader"
Get the configuration loader from the type.
load_
agent_
config_
from_
json
| load_agent_config_from_json(configuration_json: List[Dict], validate: bool = True) -> AgentConfig
Load agent configuration from configuration json data.
Arguments:
configuration_json
: list of dicts with aea configuration
Returns:
AgentConfig instance
ConfigLoaders Objects
class ConfigLoaders()
Configuration Loader class to load any package type.
from_
package_
type
| @classmethod
| from_package_type(cls, configuration_type: Union[PackageType, str]) -> "ConfigLoader"
Get a config loader from the configuration type.
Arguments:
configuration_type
: the configuration type
load_
component_
configuration
load_component_configuration(component_type: ComponentType, directory: Path, skip_consistency_check: bool = False) -> ComponentConfiguration
Load configuration and check that it is consistent against the directory.
Arguments:
component_type
: the component type.directory
: the root of the packageskip_consistency_check
: if True, the consistency check are skipped.
Returns:
the configuration object.
load_
package_
configuration
load_package_configuration(package_type: PackageType, directory: Path, skip_consistency_check: bool = False) -> PackageConfiguration
Load configuration and check that it is consistent against the directory.
Arguments:
package_type
: the package type.directory
: the root of the packageskip_consistency_check
: if True, the consistency check are skipped.
Returns:
the configuration object.