aea.configurations.loader
Implementation of the parser for configuration file.
BaseConfigLoader Objects
Base class for configuration loader classes.
__
init__
Initialize the parser for configuration files.
Arguments:
schema_filename
: the path to the JSON-schema file in 'aea/configurations/schemas'.
validator
Get the json schema validator.
validate
Validate a JSON object.
Arguments:
json_data
: the JSON data.
required_
fields
Get the required fields.
Returns:
list of required fields.
ConfigLoader Objects
Parsing, serialization and validation for package configuration files.
__
init__
| __init__(schema_filename: str, configuration_class: Type[T], skip_aea_validation: bool = True) -> None
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.)skip_aea_validation
: if True, the validation of the AEA version is skipped.
configuration_
class
Get the configuration class of the loader.
validate
Validate a JSON representation of an AEA package.
First, checks whether the AEA version is compatible with the configuration file. Then, validates the JSON object against the specific schema.
Arguments:
json_data
: the JSON data.
load_
protocol_
specification
Load an agent configuration file.
Arguments:
file_pointer
: the file pointer to the configuration file
Returns:
the configuration object. :raises
load
Load a configuration file.
Arguments:
file_pointer
: the file pointer to the configuration file
Returns:
the configuration object.
dump
Dump a configuration.
Arguments:
configuration
: the configuration to be dumped.file_pointer
: the file pointer to the configuration file
from_
configuration_
type
| @classmethod
| from_configuration_type(cls, configuration_type: Union[PackageType, str], **kwargs: Any) -> "ConfigLoader"
Get the configuration loader from the type.
Arguments:
configuration_type
: the type of configurationkwargs
: keyword arguments to the configuration loader constructor.
Returns:
the configuration loader
load_
agent_
config_
from_
json
Load agent configuration from configuration json data.
Arguments:
configuration_json
: list of dicts with aea configurationvalidate
: whether or not to validate
Returns:
AgentConfig instance
ConfigLoaders Objects
Configuration Loader class to load any package type.
from_
package_
type
| @classmethod
| from_package_type(cls, configuration_type: Union[PackageType, str], **kwargs: Any) -> "ConfigLoader"
Get a config loader from the configuration type.
Arguments:
configuration_type
: the configuration type.kwargs
: keyword arguments to the configuration loader constructor.
Returns:
configuration loader
load_
component_
configuration
load_component_configuration(component_type: ComponentType, directory: Path, skip_consistency_check: bool = False, skip_aea_validation: bool = True) -> 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.skip_aea_validation
: if True, the validation of the AEA version is skipped.
Returns:
the configuration object.
load_
package_
configuration
load_package_configuration(package_type: PackageType, directory: Path, skip_consistency_check: bool = False, skip_aea_validation: bool = True) -> 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.skip_aea_validation
: if True, the validation of the AEA version is skipped.
Returns:
the configuration object.