Package org.a2aproject.sdk.spec
Record Class MessageSendConfiguration
java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.MessageSendConfiguration
- Record Components:
acceptedOutputModes- list of output modes the client can handle (e.g., "text", "audio")historyLength- number of previous messages to include in conversation context (must be non-negative)taskPushNotificationConfig- configuration for asynchronous push notifications when task state changes. Task id should be empty when sending this configuration in a SendMessage request.returnImmediately- whether the operation should return immediately after creating the task (defaults to false)
public record MessageSendConfiguration(@Nullable List<String> acceptedOutputModes, @Nullable Integer historyLength, @Nullable TaskPushNotificationConfig taskPushNotificationConfig, Boolean returnImmediately)
extends Record
Configuration options for
message/send and message/stream requests.
This record defines how the agent should process a message request, including output format preferences, conversation history context, push notification settings, and return behavior.
All fields are optional and have sensible defaults when not specified.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructingMessageSendConfigurationinstances. -
Constructor Summary
ConstructorsConstructorDescriptionMessageSendConfiguration(@Nullable List<String> acceptedOutputModes, @Nullable Integer historyLength, @Nullable TaskPushNotificationConfig taskPushNotificationConfig, Boolean returnImmediately) Compact constructor for validation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacceptedOutputModesrecord component.builder()Create a new Builderfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable IntegerReturns the value of thehistoryLengthrecord component.Returns the value of thereturnImmediatelyrecord component.@Nullable TaskPushNotificationConfigReturns the value of thetaskPushNotificationConfigrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageSendConfiguration
public MessageSendConfiguration(@Nullable List<String> acceptedOutputModes, @Nullable Integer historyLength, @Nullable TaskPushNotificationConfig taskPushNotificationConfig, Boolean returnImmediately) Compact constructor for validation. Validates that historyLength is non-negative if provided.- Parameters:
acceptedOutputModes- list of accepted output modeshistoryLength- maximum number of history itemstaskPushNotificationConfig- push notification configurationreturnImmediately- whether to return immediately- Throws:
IllegalArgumentException- if historyLength is negative
-
-
Method Details
-
builder
Create a new Builder- Returns:
- the builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
acceptedOutputModes
Returns the value of theacceptedOutputModesrecord component.- Returns:
- the value of the
acceptedOutputModesrecord component
-
historyLength
Returns the value of thehistoryLengthrecord component.- Returns:
- the value of the
historyLengthrecord component
-
taskPushNotificationConfig
Returns the value of thetaskPushNotificationConfigrecord component.- Returns:
- the value of the
taskPushNotificationConfigrecord component
-
returnImmediately
Returns the value of thereturnImmediatelyrecord component.- Returns:
- the value of the
returnImmediatelyrecord component
-