Skip to content

autonomy.configurations.base

Base configurations.

recurse

def recurse(obj: Dict[str, Any]) -> Dict[str, Any]

Recursively explore a json object until no dictionaries remain.

Service Objects

class Service(PackageConfiguration)

Service package configuration.

__init__

def __init__(name: SimpleIdOrStr, author: SimpleIdOrStr, agent: PublicId, version: str = "", license_: str = "", aea_version: str = "", fingerprint: Optional[Dict[str, str]] = None, fingerprint_ignore_patterns: Optional[Sequence[str]] = None, description: str = "", number_of_agents: int = 4, build_entrypoint: Optional[str] = None, overrides: Optional[List] = None) -> None

Initialise object.

overrides

@property
def overrides() -> List

Returns component overrides.

overrides

@overrides.setter
def overrides(obj: List) -> None

Set overrides.

json

@property
def json() -> Dict

Returns an ordered Dict for service config.

validate_config_data

@classmethod
def validate_config_data(cls, json_data: Dict, env_vars_friendly: bool = False) -> None

Validate config data.

check_overrides_match_spec

def check_overrides_match_spec(overrides: List) -> bool

Check that overrides are valid.

  • number of overrides is 1
  • number of overrides == number of agents in spec
  • number of overrides is 0

Arguments:

  • overrides: List of overrides

Returns:

True if overrides are valid

check_overrides_valid

def check_overrides_valid(overrides: List, env_vars_friendly: bool = False) -> Dict[ComponentId, Dict[Any, Any]]

Uses the AEA helper libraries to check individual overrides.

process_component_section

def process_component_section(component_index: int, component_configuration_json: Dict) -> Tuple[ComponentId, Dict]

Process a component configuration in an agent configuration file.

It breaks down in: - extract the component id - validate the component configuration - check that there are only configurable fields

Arguments:

  • component_index: the index of the component in the file.
  • component_configuration_json: the JSON object.

Returns:

the processed component configuration.

try_to_process_singular_override

@staticmethod
def try_to_process_singular_override(component_id: ComponentId, config_class: ComponentConfiguration, component_configuration_json: Dict) -> Dict

Try to process component with a singular component overrides.

try_to_process_nested_fields

def try_to_process_nested_fields(component_id: ComponentId, component_index: int, config_class: ComponentConfiguration, component_configuration_json: Dict) -> Dict

Try to process component with nested overrides.

Back to top