Class CohereServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<CohereServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.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>
Builder for
CohereServiceSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRequired - A valid API key for your Cohere account.build()Builds aCohereServiceSettings.embeddingType(CohereEmbeddingType value) For atext_embeddingtask, the types of embeddings you want to get back.Required - For acompletion,rerank, ortext_embeddingtask, the name of the model to use for the inference task.rateLimit(RateLimitSetting value) This setting helps to minimize the number of rate limit errors returned from Cohere.This setting helps to minimize the number of rate limit errors returned from Cohere.protected CohereServiceSettings.Builderself()similarity(CohereSimilarityType value) The similarity measure.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
For atext_embeddingtask, the types of embeddings you want to get back. Usebinaryfor binary embeddings, which are encoded as bytes with signed int8 precision. Usebitfor binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym ofbinary). Usebytefor signed int8 embeddings (this is a synonym ofint8). Usefloatfor the default float embeddings. Useint8for signed int8 embeddings.API name:
embedding_type -
modelId
Required - For acompletion,rerank, ortext_embeddingtask, the name of the model to use for the inference task.- For the available
completionmodels, refer to the Cohere command docs. - For the available
rerankmodels, refer to the Cohere rerank docs. - For the available
text_embeddingmodels, refer to Cohere embed docs.
API name:
model_id - For the available
-
rateLimit
This setting helps to minimize the number of rate limit errors returned from Cohere. By default, thecohereservice sets the number of requests allowed per minute to 10000.API name:
rate_limit -
rateLimit
public final CohereServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from Cohere. By default, thecohereservice sets the number of requests allowed per minute to 10000.API name:
rate_limit -
similarity
The similarity measure. If theembedding_typeisfloat, the default value isdot_product. If theembedding_typeisint8orbyte, the default value iscosine.API name:
similarity -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<CohereServiceSettings.Builder>
-
build
Builds aCohereServiceSettings.- Specified by:
buildin interfaceObjectBuilder<CohereServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-