WithLLMSampling and LLMReasoning.
Fields are provider-agnostic — each LLM client maps them to its native API.
Configure
Field mapping
| Field | OpenAI | Anthropic | Gemini |
|---|---|---|---|
Enabled | Does not infer reasoning_effort alone — standard chat models reject that parameter | If BudgetTokens is 0, uses minimum 1024 tokens for extended thinking | Helps turn on thought output (IncludeThoughts) |
Effort | Maps to reasoning_effort when non-empty — use with reasoning-capable models only | Not used for the thinking API | Maps to ThinkingLevel (low / medium / high / minimal) — only when BudgetTokens is 0 |
BudgetTokens | Not used | Extended-thinking budget (≥1024 when non-zero; values below 1024 are clamped up) | Maps to ThinkingBudget — wins over Effort when set |
Anthropic extended thinking requires
BudgetTokens ≥ 1024. The SDK clamps lower values to 1024 automatically.Streaming
When the provider returns thinking deltas, streaming emits reasoning events:| Event | When |
|---|---|
AgentEventTypeReasoningStart | Reasoning block begins |
AgentEventTypeReasoningMessageContent | Partial thinking delta — Anthropic emits this as ThinkingDelta |
AgentEventTypeReasoningEnd | Reasoning block ends |
Token usage
Reasoning tokens appear inLLMUsage.ReasoningTokens when the provider reports them. They are included in the aggregate on AgentRunResult.LLMUsage.
Example
Reasoning
Extended thinking on supported models
Related
LLM Providers
Provider clients and model selection
Streaming
Reasoning stream events
Token Usage
ReasoningTokens in usage reports
Configuration
WithLLMSampling reference