Reasoning
@SerialName(value = "reasoning")
@Serializable
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}")
}Content copied to clipboard
// 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}")
}Content copied to clipboard