Class ContextualAIServiceSettings

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

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

  • Method Details

    • of

    • apiKey

      public final String apiKey()
      Required - A valid API key for your Contexutual AI account.

      IMPORTANT: You need to provide the API key only once, during the inference model creation. The get inference endpoint API does not retrieve your API key. After creating the inference model, you cannot change the associated API key. If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.

      API name: api_key

    • modelId

      public final String modelId()
      Required - The name of the model to use for the inference task. Refer to the Contextual AI documentation for the list of available rerank models.

      API name: model_id

    • rateLimit

      @Nullable public final RateLimitSetting rateLimit()
      This setting helps to minimize the number of rate limit errors returned from Contextual AI. The contextualai service sets a default number of requests allowed per minute depending on the task type. For rerank, it is set to 1000.

      API name: rate_limit

    • 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
    • setupContextualAIServiceSettingsDeserializer

      protected static void setupContextualAIServiceSettingsDeserializer(ObjectDeserializer<ContextualAIServiceSettings.Builder> op)