Class CohereServiceSettings.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • apiKey

      public final CohereServiceSettings.Builder apiKey(String value)
      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

      public final CohereServiceSettings.Builder embeddingType(@Nullable CohereEmbeddingType value)
      For a text_embedding task, the types of embeddings you want to get back. Use binary for binary embeddings, which are encoded as bytes with signed int8 precision. Use bit for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of binary). 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

      public final CohereServiceSettings.Builder modelId(@Nullable String value)
      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

      public final CohereServiceSettings.Builder rateLimit(@Nullable RateLimitSetting value)
      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

    • 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

      public final CohereServiceSettings.Builder similarity(@Nullable CohereSimilarityType value)
      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

    • self

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

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