Record Class MessageSendParams
java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.MessageSendParams
- Record Components:
message- the message to send to the agent (required)configuration- optional configuration for message processing behaviormetadata- optional arbitrary key-value metadata for the requesttenant- optional tenant, provided as a path parameter.
public record MessageSendParams(Message message, @Nullable MessageSendConfiguration configuration, @Nullable Map<String,Object> metadata, @Nullable String tenant)
extends Record
Parameters for sending a message to an agent in the A2A Protocol.
This record encapsulates the message content, optional configuration, and metadata for agent task requests. It is used to define what message to send and how to process it.
The message can create a new task, continue an existing task (if it contains a task ID), or restart a task depending on the agent's implementation and the message context.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructingMessageSendParamsinstances. -
Constructor Summary
ConstructorsConstructorDescriptionMessageSendParams(Message message, @Nullable MessageSendConfiguration configuration, @Nullable Map<String, Object> metadata) Convenience constructor with default tenant.MessageSendParams(Message message, @Nullable MessageSendConfiguration configuration, @Nullable Map<String, Object> metadata, @Nullable String tenant) Compact constructor for validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageSendParams.Builderbuilder()Create a new Builder@Nullable MessageSendConfigurationReturns the value of theconfigurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.metadata()Returns the value of themetadatarecord component.@Nullable Stringtenant()Returns the value of thetenantrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageSendParams
public MessageSendParams(Message message, @Nullable MessageSendConfiguration configuration, @Nullable Map<String, Object> metadata, @Nullable String tenant) Compact constructor for validation. Validates that required parameters are not null.- Parameters:
message- the message to sendconfiguration- optional message send configurationmetadata- optional metadatatenant- the tenant identifier
-
MessageSendParams
public MessageSendParams(Message message, @Nullable MessageSendConfiguration configuration, @Nullable Map<String, Object> metadata) Convenience constructor with default tenant.- Parameters:
message- the message to send (required)configuration- optional configuration for message processingmetadata- optional metadata
-
-
Method Details
-
builder
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
message
-
configuration
Returns the value of theconfigurationrecord component.- Returns:
- the value of the
configurationrecord component
-
metadata
-
tenant
-