-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Gap
When users enable extended thinking via the thinking parameter (e.g., thinking={"type": "enabled", "budget_tokens": 10000}), this configuration is not captured in span metadata. The thinking parameter is absent from METADATA_PARAMS in the Anthropic wrapper.
The thinking content blocks in the response ARE captured in span.output (since the full content array is logged), and token usage is correct (Anthropic counts thinking tokens within output_tokens). The gap is that the thinking configuration itself — whether it was enabled, the budget, and the type — is invisible in span metadata.
This matters because extended thinking is a major Anthropic feature (required for Claude Opus, configurable for Sonnet) and users need visibility into how they configured it across different traces.
What is missing
Add "thinking" to METADATA_PARAMS (line 30 of anthropic.py) so the thinking configuration is logged as span metadata.
Braintrust docs status
not_found — the Anthropic integration page at braintrust.dev/docs/integrations/ai-providers/anthropic does not mention extended thinking.
Upstream sources
- Anthropic extended thinking docs: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
- The
thinkingparameter is part of the Messages API request body:{"type": "enabled", "budget_tokens": N}or{"type": "disabled"}
Local files inspected
py/src/braintrust/wrappers/anthropic.py:METADATA_PARAMS(line 30-40): includesmodel,max_tokens,temperature,top_k,top_p,stop_sequences,tool_choice,tools,stream— but NOTthinking_start_span()extracts only params listed inMETADATA_PARAMSinto span metadata
py/src/braintrust/wrappers/test_anthropic.py— no test cases for extended thinking configuration