LLMParams

data class LLMParams(val temperature: Double? = null, val numberOfChoices: Int? = null, val speculation: String? = null, val schema: LLMParams.Schema? = null, val toolChoice: LLMParams.ToolChoice? = null, val user: String? = null)(source)

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

Constructors

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

Types

Link copied to clipboard
sealed interface Schema

Represents a generic schema for structured data, defining a common contract for schemas. This is a sealed interface, enabling a restrictive set of implementations.

Link copied to clipboard

Used to switch tool calling behavior of LLM

Properties

Link copied to clipboard
val numberOfChoices: Int? = null
Link copied to clipboard
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

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
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.