aea.context.base

This module contains the agent context class.

AgentContext

class AgentContext()

Provide read access to relevant objects of the agent for the skills.

__init__

 | __init__(identity: Identity, ledger_apis: LedgerApis, connection_status: ConnectionStatus, outbox: OutBox, decision_maker_message_queue: Queue, decision_maker_handler_context: SimpleNamespace, task_manager: TaskManager, **kwargs)

Initialize an agent context.

Arguments:

  • identity: the identity object
  • ledger_apis: the APIs the agent will use to connect to ledgers.
  • connection_status: the connection status of the multiplexer
  • outbox: the outbox
  • decision_maker_message_queue: the (in) queue of the decision maker
  • decision_maker_handler_context: the decision maker's name space
  • task_manager: the task manager
  • kwargs: keyword arguments to be attached in the agent context namespace.

shared_state

 | @property
 | shared_state() -> Dict[str, Any]

Get the shared state dictionary.

The shared state is the only object which skills can use to exchange state directly. It is accessible (read and write) from all skills.

identity

 | @property
 | identity() -> Identity

Get the identity.

agent_name

 | @property
 | agent_name() -> str

Get agent name.

addresses

 | @property
 | addresses() -> Dict[str, Address]

Get addresses.

address

 | @property
 | address() -> Address

Get the default address.

connection_status

 | @property
 | connection_status() -> ConnectionStatus

Get connection status of the multiplexer.

outbox

 | @property
 | outbox() -> OutBox

Get outbox.

decision_maker_message_queue

 | @property
 | decision_maker_message_queue() -> Queue

Get decision maker queue.

decision_maker_handler_context

 | @property
 | decision_maker_handler_context() -> SimpleNamespace

Get the decision maker handler context.

ledger_apis

 | @property
 | ledger_apis() -> LedgerApis

Get the ledger APIs.

task_manager

 | @property
 | task_manager() -> TaskManager

Get the task manager.

search_service_address

 | @property
 | search_service_address() -> Address

Get the address of the search service.

namespace

 | @property
 | namespace() -> SimpleNamespace

Get the agent context namespace.