Class InferenceRequest.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<InferenceRequest.Builder>
co.elastic.clients.elasticsearch.inference.InferenceRequest.Builder
- All Implemented Interfaces:
WithJson<InferenceRequest.Builder>
,ObjectBuilder<InferenceRequest>
- Enclosing class:
- InferenceRequest
public static class InferenceRequest.Builder
extends RequestBase.AbstractBuilder<InferenceRequest.Builder>
implements ObjectBuilder<InferenceRequest>
Builder for
InferenceRequest
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aInferenceRequest
.final InferenceRequest.Builder
inferenceId
(String value) Required - The unique identifier for the inference endpoint.final InferenceRequest.Builder
Required - The text on which you want to perform the inference task.final InferenceRequest.Builder
Required - The text on which you want to perform the inference task.final InferenceRequest.Builder
Specifies the input data type for the text embedding model.final InferenceRequest.Builder
The query input, which is required only for thererank
task.protected InferenceRequest.Builder
self()
final InferenceRequest.Builder
taskSettings
(JsonData value) Task settings for the individual inference request.final InferenceRequest.Builder
The type of inference task that the model performs.final InferenceRequest.Builder
The amount of time to wait for the inference request to complete.final InferenceRequest.Builder
The amount of time to wait for the inference request to complete.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
-
inferenceId
Required - The unique identifier for the inference endpoint.API name:
inference_id
-
input
Required - The text on which you want to perform the inference task. It can be a single string or an array.info Inference endpoints for the
completion
task type currently only support a single string as input.API name:
input
Adds all elements of
list
toinput
. -
input
Required - The text on which you want to perform the inference task. It can be a single string or an array.info Inference endpoints for the
completion
task type currently only support a single string as input.API name:
input
Adds one or more values to
input
. -
inputType
Specifies the input data type for the text embedding model. Theinput_type
parameter only applies to Inference Endpoints with thetext_embedding
task type. Possible values include:SEARCH
INGEST
CLASSIFICATION
CLUSTERING
Not all services support all values. Unsupported values will trigger a validation exception. Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.
info The
input_type
parameter specified on the root level of the request body will take precedence over theinput_type
parameter specified intask_settings
.API name:
input_type
-
query
The query input, which is required only for thererank
task. It is not required for other tasks.API name:
query
-
taskSettings
Task settings for the individual inference request. These settings are specific to the task type you specified and override the task settings specified when initializing the service.API name:
task_settings
-
taskType
The type of inference task that the model performs.API name:
task_type
-
timeout
The amount of time to wait for the inference request to complete.API name:
timeout
-
timeout
The amount of time to wait for the inference request to complete.API name:
timeout
-
self
- Specified by:
self
in classRequestBase.AbstractBuilder<InferenceRequest.Builder>
-
build
Builds aInferenceRequest
.- Specified by:
build
in interfaceObjectBuilder<InferenceRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-