aea.context.base

This module contains the agent context class.

AgentContext Objects

class AgentContext()

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

__init__

 | __init__(identity: Identity, connection_status: MultiplexerStatus, outbox: OutBox, decision_maker_message_queue: Queue, decision_maker_handler_context: SimpleNamespace, task_manager: TaskManager, default_connection: Optional[PublicId], default_routing: Dict[PublicId, PublicId], search_service_address: Address, decision_maker_address: Address, **kwargs)

Initialize an agent context.

Arguments:

  • identity: the identity object
  • 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
  • default_connection: the default connection
  • default_routing: the default routing
  • search_service_address: the address of the search service
  • decision_maker_address: the address of the decision maker
  • 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() -> MultiplexerStatus

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.

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.

decision_maker_address

 | @property
 | decision_maker_address() -> Address

Get the address of the decision maker.

default_connection

 | @property
 | default_connection() -> Optional[PublicId]

Get the default connection.

default_routing

 | @property
 | default_routing() -> Dict[PublicId, PublicId]

Get the default routing.

namespace

 | @property
 | namespace() -> SimpleNamespace

Get the agent context namespace.