LLMParams

open class LLMParams(val temperature: Double? = null, val maxTokens: Int? = null, val numberOfChoices: Int? = null, val speculation: String? = null, val schema: LLMParams.Schema? = null, val toolChoice: LLMParams.ToolChoice? = null, val user: String? = null, val includeThoughts: Boolean? = null, val thinkingBudget: Int? = null)(source)

Represents configuration parameters for controlling the behavior of a language model.

Constructors

Link copied to clipboard
constructor(temperature: Double? = null, maxTokens: Int? = null, numberOfChoices: Int? = null, speculation: String? = null, schema: LLMParams.Schema? = null, toolChoice: LLMParams.ToolChoice? = null, user: String? = null, includeThoughts: Boolean? = null, thinkingBudget: Int? = null)

Types

Link copied to clipboard
sealed interface Schema

Represents a schema for the structured response.

Link copied to clipboard

Used to switch tool calling behavior of LLM

Properties

Link copied to clipboard

If true, requests the model to add reasoning blocks to the response. Defaults to null. When set to true, responses may include detailed reasoning steps. When false or null, responses are typically shorter and faster.

Link copied to clipboard
val maxTokens: Int? = null

Maximum number of tokens to generate in the response.

Link copied to clipboard
val numberOfChoices: Int? = null

Specifies the number of alternative completions to generate.

Link copied to clipboard

Defines the structure for the model's structured response format.

Link copied to clipboard
val speculation: String? = null

Reserved for speculative proposition of how result would look like, supported only by a number of models, but may greatly improve speed and accuracy of result. For example, in OpenAI that feature is called PredictedOutput

Link copied to clipboard
val temperature: Double? = null

A parameter to control the randomness in the output. Higher values encourage more diverse results, while lower values produce deterministically focused outputs. The value is optional and defaults to null.

Link copied to clipboard
val thinkingBudget: Int? = null

Hard cap for reasoning tokens. Ignored by models that don't support budgets. This can be used to limit the amount of tokens used for reasoning when includeThoughts is enabled.

Link copied to clipboard

Used to switch tool calling behavior of LLM.

Link copied to clipboard
val user: String? = null

An optional identifier for the user making the request, which can be used for tracking purposes.

Functions

Link copied to clipboard
operator fun component1(): Double?

Component functions for destructuring declarations

Link copied to clipboard
operator fun component2(): Int?
Link copied to clipboard
operator fun component3(): Int?
Link copied to clipboard
operator fun component4(): String?
Link copied to clipboard
operator fun component5(): LLMParams.Schema?
Link copied to clipboard
Link copied to clipboard
operator fun component7(): String?
Link copied to clipboard
operator fun component8(): Boolean?
Link copied to clipboard
operator fun component9(): Int?
Link copied to clipboard
open fun copy(temperature: Double? = this.temperature, maxTokens: Int? = this.maxTokens, numberOfChoices: Int? = this.numberOfChoices, speculation: String? = this.speculation, schema: LLMParams.Schema? = this.schema, toolChoice: LLMParams.ToolChoice? = this.toolChoice, user: String? = this.user, includeThoughts: Boolean? = this.includeThoughts, thinkingBudget: Int? = this.thinkingBudget): LLMParams

Creates a copy of this instance with the ability to modify any of its properties.

Link copied to clipboard
fun default(default: LLMParams): LLMParams

Combines the parameters of the current LLMParams instance with the provided default LLMParams to produce a new instance. Fields that are null in the current instance are replaced by the corresponding fields from the default instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String