Class: A2A::Message
- Inherits:
-
ProtocolStruct
- Object
- Dry::Struct
- ProtocolStruct
- A2A::Message
- Defined in:
- lib/a2a/types/message.rb
Overview
Represents a single message in the conversation between a user and an agent.
Instance Method Summary collapse
-
#context_id ⇒ String?
The context ID for this message, used to group related interactions.
-
#extensions ⇒ Array<String>?
The URIs of extensions that are relevant to this message.
-
#kind ⇒ String
The type of this object, used as a discriminator.
-
#message_id ⇒ String
A unique identifier for the message, typically a UUID, generated by the sender.
-
#metadata ⇒ Hash?
Optional metadata for extensions.
-
#parts ⇒ Array<Part>
An array of content parts that form the message body.
-
#reference_task_ids ⇒ Array<String>?
A list of other task IDs that this message references for additional context.
-
#role ⇒ String
Identifies the sender of the message.
-
#task_id ⇒ String?
The ID of the task this message is part of.
Methods included from Extensions::CaseTransformation
Instance Method Details
#context_id ⇒ String?
Returns The context ID for this message, used to group related interactions.
30 |
# File 'lib/a2a/types/message.rb', line 30 attribute? :context_id, Types::String.optional |
#extensions ⇒ Array<String>?
Returns The URIs of extensions that are relevant to this message.
17 |
# File 'lib/a2a/types/message.rb', line 17 attribute? :extensions, Types::Array.of(Types::String).optional |
#kind ⇒ String
Returns The type of this object, used as a discriminator. Always ‘message’ for a Message.
33 |
# File 'lib/a2a/types/message.rb', line 33 attribute :kind, Types::String.constant('message') |
#message_id ⇒ String
Returns A unique identifier for the message, typically a UUID, generated by the sender.
23 |
# File 'lib/a2a/types/message.rb', line 23 attribute :message_id, Types::String |
#metadata ⇒ Hash?
Returns Optional metadata for extensions. The key is an extension-specific identifier.
14 |
# File 'lib/a2a/types/message.rb', line 14 attribute? :metadata, Types::Hash.optional |
#parts ⇒ Array<Part>
Returns An array of content parts that form the message body. A message can be composed of multiple parts of different types (e.g., text and files).
11 |
# File 'lib/a2a/types/message.rb', line 11 attribute :parts, Types::Array.of(Types::Constructor(Part)) |
#reference_task_ids ⇒ Array<String>?
Returns A list of other task IDs that this message references for additional context.
20 |
# File 'lib/a2a/types/message.rb', line 20 attribute? :reference_task_ids, Types::Array.of(Types::String).optional |
#role ⇒ String
Returns Identifies the sender of the message. ‘user` for the client, `agent` for the service.
7 |
# File 'lib/a2a/types/message.rb', line 7 attribute :role, Types::String.enum('user', 'agent') |
#task_id ⇒ String?
Returns The ID of the task this message is part of. Can be omitted for the first message of a new task.
27 |
# File 'lib/a2a/types/message.rb', line 27 attribute? :task_id, Types::String.optional |