Class AnthropicTaskSettings.Builder

All Implemented Interfaces:
WithJson<AnthropicTaskSettings.Builder>, ObjectBuilder<AnthropicTaskSettings>
Enclosing class:
AnthropicTaskSettings

public static class AnthropicTaskSettings.Builder extends WithJsonObjectBuilderBase<AnthropicTaskSettings.Builder> implements ObjectBuilder<AnthropicTaskSettings>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • maxTokens

      public final AnthropicTaskSettings.Builder maxTokens(int value)
      Required - For a completion task, it is the maximum number of tokens to generate before stopping.

      API name: max_tokens

    • temperature

      public final AnthropicTaskSettings.Builder temperature(@Nullable Float value)
      For a completion task, it is the amount of randomness injected into the response. For more details about the supported range, refer to Anthropic documentation.

      API name: temperature

    • topK

      public final AnthropicTaskSettings.Builder topK(@Nullable Integer value)
      For a completion task, it specifies to only sample from the top K options for each subsequent token. It is recommended for advanced use cases only. You usually only need to use temperature.

      API name: top_k

    • topP

      public final AnthropicTaskSettings.Builder topP(@Nullable Float value)
      For a completion task, it specifies to use Anthropic's nucleus sampling. In nucleus sampling, Anthropic computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches the specified probability. You should either alter temperature or top_p, but not both. It is recommended for advanced use cases only. You usually only need to use temperature.

      API name: top_p

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<AnthropicTaskSettings.Builder>
    • build

      public AnthropicTaskSettings build()
      Specified by:
      build in interface ObjectBuilder<AnthropicTaskSettings>
      Throws:
      NullPointerException - if some of the required fields are null.