ReasoningConfig

sealed interface ReasoningConfig

Provider-agnostic configuration for model reasoning/thinking.

Some models (e.g. those with "thinking" or "chain-of-thought" capabilities) support controlling the depth of their internal reasoning process.

Use Disabled to turn off reasoning, or Enabled with a specific Level.

Samples

// Reasoning is supported by all ChatClient and koryChat methods that use koryChatRequest.
// Reasoning is optional field.

// Kory chat with low reasoning.
val chat = koryChat(
    model = "gpt-5.6-sol"
) {
    user("Hello")
}.asChatRequest( // Cast to chat request for use reasoning field.
    reasoning = ReasoningConfig.Enabled(ReasoningConfig.Level.LOW) // The ReasoningConfig.Enabled data class takes a ReasoningConfig.Level
)

// Warning! Not all APIs support all ReasoningConfig levels
// For example, Groq supports only LOW, MEDIUM, and HIGH, as well as null to disable reasoning.

// Kory chat request with no reasoning.
val request = koryChatRequest {
    reasoning = null // Or use ReasoningConfig.Disabled, Or use ReasoningConfig.Disabled, but not all providers may support this field.
    // See your API provider documentation. Reasoning is optional field(default: null)
    chat(
        model = "gpt-5.6-sol"
    ) {
        user("Ping!")
    }
}

Inheritors

Types

Link copied to clipboard

Reasoning is disabled.

Link copied to clipboard
data class Enabled(val level: ReasoningConfig.Level = Level.MEDIUM) : ReasoningConfig

Reasoning is enabled at a specific level.

Link copied to clipboard

Reasoning effort levels, from minimal to maximum.