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.

See Also:
  • 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 modes
      historyLength - maximum number of history items
      taskPushNotificationConfig - push notification configuration
      returnImmediately - whether to return immediately
      Throws:
      IllegalArgumentException - if historyLength is negative
  • Method Details

    • builder

      public static MessageSendConfiguration.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • acceptedOutputModes

      public @Nullable List<String> acceptedOutputModes()
      Returns the value of the acceptedOutputModes record component.
      Returns:
      the value of the acceptedOutputModes record component
    • historyLength

      public @Nullable Integer historyLength()
      Returns the value of the historyLength record component.
      Returns:
      the value of the historyLength record component
    • taskPushNotificationConfig

      public @Nullable TaskPushNotificationConfig taskPushNotificationConfig()
      Returns the value of the taskPushNotificationConfig record component.
      Returns:
      the value of the taskPushNotificationConfig record component
    • returnImmediately

      public Boolean returnImmediately()
      Returns the value of the returnImmediately record component.
      Returns:
      the value of the returnImmediately record component