Interface Request.Builder

Enclosing interface:
Request

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

    • 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 Object 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.
      Parameters:
      variantCount - The number of variants.
      Returns:
      This builder instance.
      Since:
      5.2.240708
    • create

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