Reasoning

@SerialName(value = "reasoning")
@Serializable
data class Reasoning(val value: String) : Content.Response, Content.StreamResponse

Model reasoning/thinking content.

Contains the model's internal reasoning process (sometimes called "thinking" or "chain-of-thought"). Implements both Response and StreamResponse.

Samples

when (content) { // Content is Content.StreamResponse!
    is Content.Text -> println("Text chunk: ${content.text}")
    is Content.Reasoning -> println("Reasoning chunk: ${content.value}")
    is Content.ToolCallDelta -> println("Tool call delta ${content.name}, ${content.argumentsChunk}")
}
// Working with Content.Response:
when (contentResponse) {
    is Content.Parts -> println("Parts: ${contentResponse.parts}")
    is Content.Reasoning -> println("Reasoning: ${contentResponse.value}")
    is Content.Text -> println("Output: ${contentResponse.text}")
    is Content.ToolCall -> println("Tool call: ${contentResponse.name} with ${contentResponse.argumentsJson}")
}

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard

The reasoning text.

Functions

Link copied to clipboard

Attempts to cast this response content to a request-compatible content type.