Class: A2A::Message

Inherits:
ProtocolStruct
  • Object
show all
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

Methods included from Extensions::CaseTransformation

#camelize, included, #to_json

Instance Method Details

#context_idString?

Returns The context ID for this message, used to group related interactions.

Returns:

  • (String, nil)

    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

#extensionsArray<String>?

Returns The URIs of extensions that are relevant to this message.

Returns:

  • (Array<String>, nil)

    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

#kindString

Returns The type of this object, used as a discriminator. Always ‘message’ for a Message.

Returns:

  • (String)

    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_idString

Returns A unique identifier for the message, typically a UUID, generated by the sender.

Returns:

  • (String)

    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

#metadataHash?

Returns Optional metadata for extensions. The key is an extension-specific identifier.

Returns:

  • (Hash, nil)

    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

#partsArray<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).

Returns:

  • (Array<Part>)

    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_idsArray<String>?

Returns A list of other task IDs that this message references for additional context.

Returns:

  • (Array<String>, nil)

    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

#roleString

Returns Identifies the sender of the message. ‘user` for the client, `agent` for the service.

Returns:

  • (String)

    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_idString?

Returns The ID of the task this message is part of. Can be omitted for the first message of a new task.

Returns:

  • (String, nil)

    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