ChatCompletionRequest
data class ChatCompletionRequest(val messages: List<Message>, val model: String, val store: Boolean = false, val reasoningEffort: String = "medium", val metadata: Metadata? = null, val maxCompletionTokens: Int? = null, val frequencyPenalty: Double? = 0.0, val responseFormat: ResponseFormat? = null, val temperature: Double = 1.0, val seed: Int? = null, val stream: Boolean = false, val streamOptions: ChatCompletionStreamOptions? = null, val tools: List<Tool>? = null)(source)
Represents a request for generating a chat-based completions in an OpenAI-like environment.
This data class is used for serialization and defines the parameters required to send a chat completions request, including the input messages, model to use, and various tuning parameters.
See also
Constructors
Link copied to clipboard
constructor(messages: List<Message>, model: String, store: Boolean = false, reasoningEffort: String = "medium", metadata: Metadata? = null, maxCompletionTokens: Int? = null, frequencyPenalty: Double? = 0.0, responseFormat: ResponseFormat? = null, temperature: Double = 1.0, seed: Int? = null, stream: Boolean = false, streamOptions: ChatCompletionStreamOptions? = null, tools: List<Tool>? = null)
Properties
Link copied to clipboard
The penalty value for repetitive token usage in the response.
Link copied to clipboard
The maximum number of tokens allowed in the generated completions.
Link copied to clipboard
Specifies the level of computational effort to apply during reasoning ("low", "medium", "high").
Link copied to clipboard
Defines the response format, including optional JSON schema support.
Link copied to clipboard
Link copied to clipboard
A value between 0.0 and 1.0 that controls the randomness of the generated response.