aea.configurations.base
Classes to handle AEA configurations.
dependencies_
from_
json
Parse a JSON object to get an instance of Dependencies.
Arguments:
obj
: a dictionary whose keys are package names and values are dictionary with package specifications.
Returns:
a Dependencies object.
dependencies_
to_
json
Transform a Dependencies object into a JSON object.
Arguments:
dependencies
: an instance of "Dependencies" type.
Returns:
a dictionary whose keys are package names and values are the JSON version of a Dependency object.
ProtocolSpecificationParseError Objects
Exception for parsing a protocol specification file.
Configuration Objects
Configuration class.
__
init__
Initialize a configuration object.
from_
json
Build from a JSON object.
ordered_
json
Reorder the dictionary according to a key ordering.
This method takes all the keys in the key_order list and get the associated value in the dictionary (if present). For the remaining keys not considered in the order, it will use alphanumerical ordering.
In particular, if key_order is an empty sequence, this reduces to alphanumerical sorting.
It does not do side-effect.
Returns:
the ordered dictionary.
PackageConfiguration Objects
This class represent a package configuration.
A package can be one of: - agents - protocols - connections - skills - contracts
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None) -> None
Initialize a package configuration.
Arguments:
name
: the name of the package.author
: the author of the package.version
: the version of the package (SemVer format).license_
: the license.aea_version
: either a fixed version, or a set of specifiers describing the AEA versions allowed. (default: empty string - no constraint). The fixed version is interpreted with the specifier '=='.fingerprint
: the fingerprint.fingerprint_ignore_patterns
: a list of file patterns to ignore files to fingerprint.build_entrypoint
: path to a script to execute at build time.
name
Get the name.
name
Set the name.
author
Get the author.
author
Set the author.
aea_
version
Get the 'aea_version' attribute.
aea_
version
Set the 'aea_version' attribute.
check_
aea_
version
Check that the AEA version matches the specifier set.
:raises ValueError if the version of the aea framework falls within a specifier.
directory
Get the path to the configuration file associated to this file, if any.
directory
Set directory if not already set.
package_
id
Get package id.
parse_
aea_
version_
specifier
Parse an 'aea_version' field.
If 'aea_version' is a version, then output the specifier set "==${version}" Else, interpret it as specifier set.
Arguments:
aea_version_specifiers
: the AEA version, or a specifier set.
Returns:
A specifier set object.
aea_
version_
specifiers
Get the AEA version set specifier.
public_
id
Get the public id.
package_
dependencies
Get the package dependencies.
update
Update configuration with other data.
Arguments:
data
: the data to replace.env_vars_friendly
: whether or not it is env vars friendly.
validate_
config_
data
| @classmethod
| validate_config_data(cls, json_data: Dict, env_vars_friendly: bool = False) -> None
Perform config validation.
from_
json
Initialize from a JSON object.
make_
resulting_
config_
data
Make config data with overrides applied.
Does not update config, just creates json representation.
Arguments:
overrides
: the overrides
Returns:
config with overrides applied
check_
overrides_
valid
Check overrides is correct, return list of errors if present.
get_
overridable
Get dictionary of values that can be updated for this config.
ComponentConfiguration Objects
Class to represent an agent component configuration.
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, build_directory: Optional[str] = None, dependencies: Optional[Dependencies] = None) -> None
Set component configuration.
build_
directory
Get the component type.
build_
directory
Get the component type.
component_
type
Get the component type.
component_
id
Get the component id.
prefix_
import_
path
Get the prefix import path for this component.
is_
abstract_
component
Check whether the component is abstract.
check_
fingerprint
Check that the fingerprint are correct against a directory path.
Arguments:
directory
: the directory path.
Raises:
ValueError
: if- the argument is not a valid package directory
- the fingerprints do not match.
check_
public_
id_
consistency
Check that the public ids in the init file match the config.
Arguments:
directory
: the directory path.
Raises:
ValueError
: if- the argument is not a valid package directory
- the public ids do not match.
ConnectionConfig Objects
Handle connection configuration.
__
init__
| __init__(name: SimpleIdOrStr = "", author: SimpleIdOrStr = "", version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, build_directory: Optional[str] = None, class_name: str = "", protocols: Optional[Set[PublicId]] = None, connections: Optional[Set[PublicId]] = None, restricted_to_protocols: Optional[Set[PublicId]] = None, excluded_protocols: Optional[Set[PublicId]] = None, dependencies: Optional[Dependencies] = None, description: str = "", connection_id: Optional[PublicId] = None, is_abstract: bool = False, cert_requests: Optional[List[CertRequest]] = None, **config: Any, ,) -> None
Initialize a connection configuration object.
package_
dependencies
Get the connection dependencies.
is_
abstract_
component
Check whether the component is abstract.
json
Return the JSON representation.
ProtocolConfig Objects
Handle protocol configuration.
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, build_directory: Optional[str] = None, aea_version: str = "", dependencies: Optional[Dependencies] = None, description: str = "", protocol_specification_id: Optional[str] = None) -> None
Initialize a connection configuration object.
json
Return the JSON representation.
SkillComponentConfiguration Objects
This class represent a skill component configuration.
__
init__
Initialize a skill component configuration.
Arguments:
class_name
: the class name of the component.file_path
: the file path.args
: keyword arguments.
json
Return the JSON representation.
from_
json
Initialize from a JSON object.
SkillConfig Objects
Class to represent a skill configuration file.
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, build_directory: Optional[str] = None, connections: Optional[Set[PublicId]] = None, protocols: Optional[Set[PublicId]] = None, contracts: Optional[Set[PublicId]] = None, skills: Optional[Set[PublicId]] = None, dependencies: Optional[Dependencies] = None, description: str = "", is_abstract: bool = False) -> None
Initialize a skill configuration.
package_
dependencies
Get the skill dependencies.
is_
abstract_
component
Check whether the component is abstract.
json
Return the JSON representation.
get_
overridable
Get overridable configuration data.
AgentConfig Objects
Class to represent the agent configuration file.
__
init__
| __init__(agent_name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, description: str = "", logging_config: Optional[Dict] = None, period: Optional[float] = None, execution_timeout: Optional[float] = None, max_reactions: Optional[int] = None, error_handler: Optional[Dict] = None, decision_maker_handler: Optional[Dict] = None, skill_exception_policy: Optional[str] = None, connection_exception_policy: Optional[str] = None, default_ledger: Optional[str] = None, required_ledgers: Optional[List[str]] = None, currency_denominations: Optional[Dict[str, str]] = None, default_connection: Optional[str] = None, default_routing: Optional[Dict[str, str]] = None, loop_mode: Optional[str] = None, runtime_mode: Optional[str] = None, task_manager_mode: Optional[str] = None, storage_uri: Optional[str] = None, data_dir: Optional[str] = None, component_configurations: Optional[Dict[ComponentId, Dict]] = None, dependencies: Optional[Dependencies] = None) -> None
Instantiate the agent configuration object.
component_
configurations
Get the custom component configurations.
component_
configurations
Set the component configurations.
package_
dependencies
Get the package dependencies.
private_
key_
paths_
dict
Get dictionary version of private key paths.
connection_
private_
key_
paths_
dict
Get dictionary version of connection private key paths.
component_
configurations_
json
Get the component configurations in JSON format.
json
Return the JSON representation.
all_
components_
id
Get list of the all components for this agent config.
update
Update configuration with other data.
To update the component parts, populate the field "component_configurations" as a mapping from ComponentId to configurations.
Arguments:
data
: the data to replace.env_vars_friendly
: whether or not it is env vars friendly.
SpeechActContentConfig Objects
Handle a speech_act content configuration.
__
init__
Initialize a speech_act content configuration.
json
Return the JSON representation.
from_
json
Initialize from a JSON object.
ProtocolSpecification Objects
Handle protocol specification.
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", description: str = "", protocol_specification_id: Optional[str] = None) -> None
Initialize a protocol specification configuration object.
protobuf_
snippets
Get the protobuf snippets.
protobuf_
snippets
Set the protobuf snippets.
dialogue_
config
Get the dialogue config.
dialogue_
config
Set the dialogue config.
json
Return the JSON representation.
ContractConfig Objects
Handle contract configuration.
__
init__
| __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, build_entrypoint: Optional[str] = None, build_directory: Optional[str] = None, dependencies: Optional[Dependencies] = None, description: str = "", contract_interface_paths: Optional[Dict[str, str]] = None, class_name: str = "") -> None
Initialize a protocol configuration object.
json
Return the JSON representation.
AEAVersionError Objects
Special Exception for version error.
__
init__
Init exception.