Class CohereServiceSettings

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

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

  • Method Details

    • of

    • apiKey

      public final String apiKey()
      Required - A valid API key for your Cohere account. You can find or create your Cohere API keys on the Cohere API key settings page.

      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

    • embeddingType

      @Nullable public final CohereEmbeddingType embeddingType()
      For a text_embedding task, the types of embeddings you want to get back. Use byte for signed int8 embeddings (this is a synonym of int8). Use float for the default float embeddings. Use int8 for signed int8 embeddings.

      API name: embedding_type

    • modelId

      @Nullable public final String modelId()
      For a completion, rerank, or text_embedding task, the name of the model to use for the inference task.

      The default value for a text embedding task is embed-english-v2.0.

      API name: model_id

    • rateLimit

      @Nullable public final RateLimitSetting rateLimit()
      This setting helps to minimize the number of rate limit errors returned from Cohere. By default, the cohere service sets the number of requests allowed per minute to 10000.

      API name: rate_limit

    • similarity

      @Nullable public final CohereSimilarityType similarity()
      The similarity measure. If the embedding_type is float, the default value is dot_product. If the embedding_type is int8 or byte, the default value is cosine.

      API name: similarity

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

      protected static void setupCohereServiceSettingsDeserializer(ObjectDeserializer<CohereServiceSettings.Builder> op)