ChatCompletionRequestBuilder

Builder class for creating ChatCompletionRequest instances.

This builder provides a fluent API for creating chat completion requests, making it easier to construct complex requests with many parameters.

Example usage:

val request = ChatCompletionRequestBuilder()
.model("gpt-4")
.addSystemMessage("You are a helpful assistant.")
.addUserMessage("Tell me about Kotlin.")
.temperature(0.7)
.build()

Author

Konstantin Pavlov

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Adds an assistant message to the conversation.

Link copied to clipboard

Adds a message with structured content parts to the conversation.

Adds a message to the conversation.

Link copied to clipboard

Adds a system message to the conversation.

Link copied to clipboard

Adds a user message to the conversation.

Link copied to clipboard

Builds a ChatCompletionRequest instance with the configured parameters.

Link copied to clipboard

Sets the penalty value for repetitive token usage.

Link copied to clipboard

Sets the maximum number of tokens allowed in the generated completions.

Link copied to clipboard

Sets the metadata for the request.

Link copied to clipboard

Sets the model to use for the completion.

Link copied to clipboard

Sets the reasoning effort to apply during reasoning.

Link copied to clipboard

Sets the response format.

Link copied to clipboard

Sets the seed for deterministic responses.

Link copied to clipboard

Sets whether to store the conversation context.

Link copied to clipboard

Sets whether to stream the response.

Link copied to clipboard

Sets the stream options.

Link copied to clipboard

Sets the temperature for controlling randomness.

Link copied to clipboard

Sets the tools available to the model.