Class CohereTaskSettings
java.lang.Object
co.elastic.clients.elasticsearch.inference.CohereTaskSettings
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<CohereTaskSettings>Json deserializer forCohereTaskSettings -
Method Summary
Modifier and TypeMethodDescriptionfinal CohereInputTypeRequired - For atext_embeddingtask, the type of input passed to the model.static CohereTaskSettingsfinal BooleanFor areranktask, return doc text within the results.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal IntegertopN()For areranktask, the number of most relevant documents to return.toString()final CohereTruncateTypetruncate()For atext_embeddingtask, the method to handle inputs longer than the maximum token length.
-
Field Details
-
_DESERIALIZER
Json deserializer forCohereTaskSettings
-
-
Method Details
-
of
public static CohereTaskSettings of(Function<CohereTaskSettings.Builder, ObjectBuilder<CohereTaskSettings>> fn) -
inputType
Required - For atext_embeddingtask, the type of input passed to the model. Valid values are:classification: Use it for embeddings passed through a text classifier.clustering: Use it for the embeddings run through a clustering algorithm.ingest: Use it for storing document embeddings in a vector database.search: Use it for storing embeddings of search queries run against a vector database to find relevant documents.
IMPORTANT: The
input_typefield is required when using embedding modelsv3and higher.API name:
input_type -
returnDocuments
For areranktask, return doc text within the results.API name:
return_documents -
topN
For areranktask, the number of most relevant documents to return. It defaults to the number of the documents. If this inference endpoint is used in atext_similarity_rerankerretriever query andtop_nis set, it must be greater than or equal torank_window_sizein the query.API name:
top_n -
truncate
For atext_embeddingtask, the method to handle inputs longer than the maximum token length. Valid values are:END: When the input exceeds the maximum input token length, the end of the input is discarded.NONE: When the input exceeds the maximum input token length, an error is returned.START: When the input exceeds the maximum input token length, the start of the input is discarded.
API name:
truncate -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupCohereTaskSettingsDeserializer
protected static void setupCohereTaskSettingsDeserializer(ObjectDeserializer<CohereTaskSettings.Builder> op)
-