Class CohereServiceSettings
java.lang.Object
co.elastic.clients.elasticsearch.inference.CohereServiceSettings
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<CohereServiceSettings>
Json deserializer forCohereServiceSettings
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
apiKey()
Required - A valid API key for your Cohere account.final CohereEmbeddingType
For atext_embedding
task, the types of embeddings you want to get back.final String
modelId()
For acompletion
,rerank
, ortext_embedding
task, the name of the model to use for the inference task.static CohereServiceSettings
final RateLimitSetting
This setting helps to minimize the number of rate limit errors returned from Cohere.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final CohereSimilarityType
The similarity measure.toString()
-
Field Details
-
_DESERIALIZER
Json deserializer forCohereServiceSettings
-
-
Method Details
-
of
public static CohereServiceSettings of(Function<CohereServiceSettings.Builder, ObjectBuilder<CohereServiceSettings>> fn) -
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_embedding
task, the types of embeddings you want to get back. Usebyte
for signed int8 embeddings (this is a synonym ofint8
). Usefloat
for the default float embeddings. Useint8
for signed int8 embeddings.API name:
embedding_type
-
modelId
For acompletion
,rerank
, ortext_embedding
task, the name of the model to use for the inference task.- For the available
completion
models, refer to the Cohere command docs. - For the available
rerank
models, refer to the Cohere rerank docs. - For the available
text_embedding
models, refer to Cohere embed docs.
The default value for a text embedding task is
embed-english-v2.0
.API name:
model_id
- For the available
-
rateLimit
This setting helps to minimize the number of rate limit errors returned from Cohere. By default, thecohere
service sets the number of requests allowed per minute to 10000.API name:
rate_limit
-
similarity
The similarity measure. If theembedding_type
isfloat
, the default value isdot_product
. If theembedding_type
isint8
orbyte
, the default value iscosine
.API name:
similarity
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupCohereServiceSettingsDeserializer
protected static void setupCohereServiceSettingsDeserializer(ObjectDeserializer<CohereServiceSettings.Builder> op)
-