Class ChatCompletionUnifiedRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.inference.ChatCompletionUnifiedRequest
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class ChatCompletionUnifiedRequest
extends RequestBase
implements JsonpSerializable
Perform chat completion inference
The chat completion inference API enables real-time responses for chat
completion tasks by delivering answers incrementally, reducing response times
during computation. It only works with the chat_completion task
type.
NOTE: The chat_completion task type is only available within the
_stream API and only supports streaming. The Chat completion inference API
and the Stream inference API differ in their response structure and
capabilities. The Chat completion inference API provides more comprehensive
customization options through more fields and function calling support. To
determine whether a given inference service supports this task type, please
see the page for that service.
- 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<ChatCompletionUnifiedRequest>static final Endpoint<ChatCompletionUnifiedRequest,BinaryResponse, ErrorResponse> Endpoint "inference.chat_completion_unified". -
Method Summary
Modifier and TypeMethodDescriptionfinal RequestChatCompletionRequired - Request body.protected static JsonpDeserializer<ChatCompletionUnifiedRequest>final StringRequired - The inference Idstatic ChatCompletionUnifiedRequestrebuild()voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this value to JSON.final Timetimeout()Specifies the amount of time to wait for the inference request to complete.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
-
_ENDPOINT
Endpoint "inference.chat_completion_unified".
-
-
Method Details
-
of
-
inferenceId
Required - The inference IdAPI name:
inference_id -
timeout
Specifies the amount of time to wait for the inference request to complete.API name:
timeout -
chatCompletionRequest
Required - Request body. -
serialize
Serialize this value to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
rebuild
- Returns:
- New
ChatCompletionUnifiedRequest.Builderinitialized with field values of this instance
-
createChatCompletionUnifiedRequestDeserializer
protected static JsonpDeserializer<ChatCompletionUnifiedRequest> createChatCompletionUnifiedRequestDeserializer()
-