Interface Request.Builder

Enclosing interface:
Request

public static interface Request.Builder
Builder for a Request instance.
Since:
5.2.240708
  • Method Details

    • from

      @Contract("_ -> this") @NotNull default @NotNull Request.Builder from(@NotNull @NotNull Request request)
      Configures the request using the specified other request.
      Parameters:
      request - The request to copy the settings from.
      Returns:
      This builder instance.
      Since:
      5.2.250908
    • addMessage

      @Contract("_ -> this") @NotNull @NotNull Request.Builder addMessage(@NotNull @NotNull Message message)
      Adds a new request message.
      Parameters:
      message - The message to be added.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • attribute

      @Contract("_,_ -> this") @NotNull @NotNull Request.Builder attribute(@NotNull @NotNull String name, @Nullable @Nullable Serializable value)
      Configures a generic attribute for the request. The attributes available may depend on the configured GenerativeAIConnectorPlugin.
      Parameters:
      name - The name of the attribute.
      value - The attribute value.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • variantCount

      @Contract("_ -> this") @NotNull @NotNull Request.Builder variantCount(int variantCount)
      Configures the number of variants to be requested, 1 by default. Note that you will usually be charged based on the number of generated tokens across all generated variants. Keep also in mind that generating multiple variants may not be supported for the configured AI service.
      Parameters:
      variantCount - The number of variants.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • addTool

      @Contract("_ -> this") @NotNull @NotNull Request.Builder addTool(@NotNull @NotNull Tool tool)
      Adds a new tool definition to the request.
      Parameters:
      tool - The tool definition.
      Returns:
      This builder instance.
      Since:
      5.2.250908
      See Also:
    • create

      @NotNull @NotNull Request create()
      Creates a new request instance based on the current configuration.
      Returns:
      The new request instance.
      Since:
      5.2.240708