Class MessageSendConfiguration.Builder

java.lang.Object
org.a2aproject.sdk.spec.MessageSendConfiguration.Builder
Enclosing class:
MessageSendConfiguration

public static class MessageSendConfiguration.Builder extends Object
Builder for constructing MessageSendConfiguration instances.

Provides a fluent API for configuring message send behavior with sensible defaults.

  • Method Details

    • acceptedOutputModes

      public MessageSendConfiguration.Builder acceptedOutputModes(List<String> acceptedOutputModes)
      Sets the accepted output modes.
      Parameters:
      acceptedOutputModes - list of output modes the client can handle
      Returns:
      this builder
    • taskPushNotificationConfig

      public MessageSendConfiguration.Builder taskPushNotificationConfig(@Nullable TaskPushNotificationConfig taskPushNotificationConfig)
      Sets the push notification configuration. Task id should be empty when sending this configuration in a SendMessage request.
      Parameters:
      taskPushNotificationConfig - configuration for push notifications
      Returns:
      this builder
    • historyLength

      public MessageSendConfiguration.Builder historyLength(@Nullable Integer historyLength)
      Sets the conversation history length.
      Parameters:
      historyLength - number of previous messages to include (must be non-negative)
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if historyLength is negative
    • returnImmediately

      public MessageSendConfiguration.Builder returnImmediately(@NonNull Boolean returnImmediately)
      Sets whether the operation should return immediately after creating the task.
      Parameters:
      returnImmediately - true to return immediately, false to wait for task completion
      Returns:
      this builder
    • build

      public MessageSendConfiguration build()
      Returns:
      a new message send configuration instance