Class StreamCompletionRequest
- All Implemented Interfaces:
JsonpSerializable
IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
This API requires the monitor_inference
cluster privilege (the
built-in inference_admin
and inference_user
roles
grant this privilege). You must use a client that supports streaming.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<StreamCompletionRequest>
Json deserializer forStreamCompletionRequest
static final Endpoint<StreamCompletionRequest,
BinaryResponse, ErrorResponse> Endpoint "inference.stream_completion
". -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Required - The unique identifier for the inference endpoint.input()
Required - The text on which you want to perform the inference task.static StreamCompletionRequest
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 JsonData
Optional task settingsMethods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forStreamCompletionRequest
-
_ENDPOINT
Endpoint "inference.stream_completion
".
-
-
Method Details
-
of
public static StreamCompletionRequest of(Function<StreamCompletionRequest.Builder, ObjectBuilder<StreamCompletionRequest>> fn) -
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.NOTE: Inference endpoints for the completion task type currently only support a single string as input.
API name:
input
-
taskSettings
Optional task settingsAPI name:
task_settings
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupStreamCompletionRequestDeserializer
protected static void setupStreamCompletionRequestDeserializer(ObjectDeserializer<StreamCompletionRequest.Builder> op)
-