Class AnthropicTaskSettings

java.lang.Object
co.elastic.clients.elasticsearch.inference.AnthropicTaskSettings
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class AnthropicTaskSettings extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • maxTokens

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

      API name: max_tokens

    • temperature

      @Nullable public final Float temperature()
      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

      @Nullable public final Integer topK()
      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

      @Nullable public final Float topP()
      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

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupAnthropicTaskSettingsDeserializer

      protected static void setupAnthropicTaskSettingsDeserializer(ObjectDeserializer<AnthropicTaskSettings.Builder> op)