LLMReasoning through WithLLMSampling and streams the run to observe thinking output (e.g. Anthropic extended thinking).
Source: examples/agent_with_reasoning/
What it demonstrates
WithLLMSamplingwithReasoning: &interfaces.LLMReasoning{...}- Provider-specific mapping of
Enabled,Effort,BudgetTokens - Streaming reasoning-related events
Run
Fromexamples/:
claude-sonnet-4-20250514 with Anthropic, or o3 with OpenAI.
Expected output
With Anthropic extended thinking enabled you will see thinking deltas on stderr (or as events) followed by the final answer:Learn more
Reasoning
Field mapping per provider
Stream
Streaming event handling