Class RequestChatCompletion

java.lang.Object
co.elastic.clients.elasticsearch.inference.RequestChatCompletion
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class RequestChatCompletion extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • messages

      public final List<Message> messages()
      Required - A list of objects representing the conversation.

      API name: messages

    • model

      @Nullable public final String model()
      The ID of the model to use.

      API name: model

    • maxCompletionTokens

      @Nullable public final Long maxCompletionTokens()
      The upper bound limit for the number of tokens that can be generated for a completion request.

      API name: max_completion_tokens

    • stop

      public final List<String> stop()
      A sequence of strings to control when the model should stop generating additional tokens.

      API name: stop

    • temperature

      @Nullable public final Float temperature()
      The sampling temperature to use.

      API name: temperature

    • toolChoice

      @Nullable public final CompletionToolType toolChoice()
      Controls which tool is called by the model.

      API name: tool_choice

    • tools

      public final List<CompletionTool> tools()
      A list of tools that the model can call.

      API name: tools

    • topP

      @Nullable public final Float topP()
      Nucleus sampling, an alternative to sampling with temperature.

      API name: top_p

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setupRequestChatCompletionDeserializer

      protected static void setupRequestChatCompletionDeserializer(ObjectDeserializer<RequestChatCompletion.Builder> op)