Class RequestChatCompletion
java.lang.Object
co.elastic.clients.elasticsearch.inference.RequestChatCompletion
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<RequestChatCompletion>Json deserializer forRequestChatCompletion -
Method Summary
Modifier and TypeMethodDescriptionfinal LongThe upper bound limit for the number of tokens that can be generated for a completion request.messages()Required - A list of objects representing the conversation.final Stringmodel()The ID of the model to use.static RequestChatCompletionvoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidstop()A sequence of strings to control when the model should stop generating additional tokens.final FloatThe sampling temperature to use.final CompletionToolTypeControls which tool is called by the model.final List<CompletionTool>tools()A list of tools that the model can call.final FloattopP()Nucleus sampling, an alternative to sampling with temperature.toString()
-
Field Details
-
_DESERIALIZER
Json deserializer forRequestChatCompletion
-
-
Method Details
-
of
public static RequestChatCompletion of(Function<RequestChatCompletion.Builder, ObjectBuilder<RequestChatCompletion>> fn) -
messages
Required - A list of objects representing the conversation. Requests should generally only add new messages from the user (roleuser). The other message roles (assistant,system, ortool) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.API name:
messages -
model
The ID of the model to use.API name:
model -
maxCompletionTokens
The upper bound limit for the number of tokens that can be generated for a completion request.API name:
max_completion_tokens -
stop
A sequence of strings to control when the model should stop generating additional tokens.API name:
stop -
temperature
The sampling temperature to use.API name:
temperature -
toolChoice
Controls which tool is called by the model. String representation: One ofauto,none, orrequrired.autoallows the model to choose between calling tools and generating a message.nonecauses the model to not call any tools.requiredforces the model to call one or more tools. Example (object representation):{ "tool_choice": { "type": "function", "function": { "name": "get_current_weather" } } }API name:
tool_choice -
tools
A list of tools that the model can call. Example:{ "tools": [ { "type": "function", "function": { "name": "get_price_of_item", "description": "Get the current price of an item", "parameters": { "type": "object", "properties": { "item": { "id": "12345" }, "unit": { "type": "currency" } } } } } ] }API name:
tools -
topP
Nucleus sampling, an alternative to sampling with temperature.API name:
top_p -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupRequestChatCompletionDeserializer
protected static void setupRequestChatCompletionDeserializer(ObjectDeserializer<RequestChatCompletion.Builder> op)
-