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, val additionalProperties: Map<String, JsonElement>? = 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, additionalProperties: Map<String, JsonElement>? = 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

Additional properties that can be used to store custom parameters.

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?

Retrieves the value of the temperature as a nullable Double. This function is typically used in destructuring declarations.

Link copied to clipboard
operator fun component10(): Map<String, JsonElement>?
Link copied to clipboard
operator fun component2(): Int?

Provides the second component of the object, corresponding to maxTokens.

Link copied to clipboard
operator fun component3(): Int?

Retrieves the third component of the data structure, representing the number of choices.

Link copied to clipboard
operator fun component4(): String?

Retrieves the fourth component of the data structure.

Link copied to clipboard
operator fun component5(): LLMParams.Schema?

Provides the fifth component of the data structure, represented by the schema property.

Link copied to clipboard

Retrieves the sixth component of a destructured object, which represents a tool choice.

Link copied to clipboard
operator fun component7(): String?

Retrieves the seventh component of the data class, typically used for destructuring declarations.

Link copied to clipboard
operator fun component8(): Boolean?

Retrieves the eighth component of the data class, typically used for destructuring declarations.

Link copied to clipboard
operator fun component9(): Int?

Provides the ninth component of a destructured object, specifically the thinking budget.

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, additionalProperties: Map<String, JsonElement>? = this.additionalProperties): 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