aea.configurations.loader

Implementation of the parser for configuration file.

make_jsonschema_base_uri

make_jsonschema_base_uri(base_uri_path: Path) -> str

Make the JSONSchema base URI, cross-platform.

Arguments:

  • base_uri_path: the path to the base directory.

Returns:

the string in URI form.

ConfigLoader

class ConfigLoader(Generic[T])

This class implement parsing, serialization and validation functionalities for the 'aea' 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.)

validator

 | @property
 | validator() -> Draft4Validator

Get the json schema validator.

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 an agent configuration file.

Arguments:

  • file_pointer: the file pointer to the configuration file

Returns:

the configuration object. :raises

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.