aea.protocols.base
This module contains the base message and serialization definition.
Message Objects
This class implements a message.
Performative Objects
Performatives for the base message.
__str__
Get the string representation.
__init__
Initialize a Message object.
Arguments:
_body: the dictionary of values to hold.kwargs: any additional value to add to the body. It will overwrite the body values.
json
Get json friendly str representation of the message.
from_json
Construct message instance from json data.
valid_performatives
Get valid performatives.
has_sender
Check if it has a sender.
sender
Get the sender of the message in Address form.
sender
Set the sender of the message.
has_to
Check if it has a sender.
to
Get address of receiver.
to
Set address of receiver.
dialogue_reference
Get the dialogue_reference of the message.
message_id
Get the message_id of the message.
performative
Get the performative of the message.
target
Get the target of the message.
set
Set key and value pair.
Arguments:
key: the key.value: the value.
get
Get value for key.
is_set
Check value is set for key.
__eq__
Compare with another object.
__repr__
Get the representation of the message.
__str__
Get the string representation of the message. Abbreviated to prevent spamming of logs.
encode
Encode the message.
decode
Decode the message.
has_dialogue_info
Check whether a message has the dialogue fields populated.
More precisely, it checks whether the fields 'message_id', 'target' and 'dialogue_reference' are set.
Returns:
True if the message has the dialogue fields set, False otherwise.
Encoder Objects
Encoder interface.
encode
Encode a message.
Arguments:
msg: the message to be encoded.
Returns:
the encoded message.
Decoder Objects
Decoder interface.
decode
Decode a message.
Arguments:
obj: the sequence of bytes to be decoded.
Returns:
the decoded message.
Serializer Objects
The implementations of this class defines a serialization layer for a protocol.
Protocol Objects
This class implements a specifications for a protocol.
It includes a serializer to encode/decode a message.
__init__
Initialize the protocol manager.
Arguments:
configuration: the protocol configurations.message_class: the message class.kwargs: the keyword arguments.
serializer
Get the serializer.
from_dir
Load the protocol from a directory.
Arguments:
directory: the directory to the skill package.kwargs: the keyword arguments.
Returns:
the protocol object.
from_config
Load the protocol from configuration.
Arguments:
configuration: the protocol configuration.kwargs: the keyword arguments.
Returns:
the protocol object.
protocol_id
Get protocol id.
protocol_specification_id
Get protocol specification id.
__repr__
Get str representation of the protocol.