Class CohereTaskSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<CohereTaskSettings.Builder>
co.elastic.clients.elasticsearch.inference.CohereTaskSettings.Builder
- All Implemented Interfaces:
WithJson<CohereTaskSettings.Builder>
,ObjectBuilder<CohereTaskSettings>
- Enclosing class:
- CohereTaskSettings
public static class CohereTaskSettings.Builder
extends WithJsonObjectBuilderBase<CohereTaskSettings.Builder>
implements ObjectBuilder<CohereTaskSettings>
Builder for
CohereTaskSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCohereTaskSettings
.inputType
(CohereInputType value) For atext_embedding
task, the type of input passed to the model.returnDocuments
(Boolean value) For arerank
task, return doc text within the results.protected CohereTaskSettings.Builder
self()
For arerank
task, the number of most relevant documents to return.truncate
(CohereTruncateType value) For atext_embedding
task, the method to handle inputs longer than the maximum token length.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
inputType
For atext_embedding
task, 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_type
field is required when using embedding modelsv3
and higher.API name:
input_type
-
returnDocuments
For arerank
task, return doc text within the results.API name:
return_documents
-
topN
For arerank
task, 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_reranker
retriever query andtop_n
is set, it must be greater than or equal torank_window_size
in the query.API name:
top_n
-
truncate
For atext_embedding
task, 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
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<CohereTaskSettings.Builder>
-
build
Builds aCohereTaskSettings
.- Specified by:
build
in interfaceObjectBuilder<CohereTaskSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-