Class ContextualAITaskSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ContextualAITaskSettings.Builder>
co.elastic.clients.elasticsearch.inference.ContextualAITaskSettings.Builder
- All Implemented Interfaces:
WithJson<ContextualAITaskSettings.Builder>,ObjectBuilder<ContextualAITaskSettings>
- Enclosing class:
- ContextualAITaskSettings
public static class ContextualAITaskSettings.Builder
extends WithJsonObjectBuilderBase<ContextualAITaskSettings.Builder>
implements ObjectBuilder<ContextualAITaskSettings>
Builder for
ContextualAITaskSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aContextualAITaskSettings.instruction(String value) Instructions for the reranking model.returnDocuments(Boolean value) Whether to return the source documents in the response.protected ContextualAITaskSettings.Builderself()The number of most relevant documents to return.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
-
instruction
Instructions for the reranking model. Refer to https://docs.contextual.ai/api-reference/rerank/rerank#body-instruction Only for thereranktask type.API name:
instruction -
returnDocuments
Whether to return the source documents in the response. Only for thereranktask type.API name:
return_documents -
topK
The number of most relevant documents to return. If not specified, the reranking results of all documents will be returned. Only for thereranktask type.API name:
top_k -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<ContextualAITaskSettings.Builder>
-
build
Builds aContextualAITaskSettings.- Specified by:
buildin interfaceObjectBuilder<ContextualAITaskSettings>- Throws:
NullPointerException- if some of the required fields are null.
-