ReqLLM.Providers.Anthropic.AdapterHelpers (ReqLLM v1.0.0)
View SourceShared helper functions for Anthropic model adapters (Bedrock, Vertex).
These functions are NOT used by the native Anthropic provider - they are specific to adapters that wrap Anthropic's API in other platforms.
Summary
Functions
Extract structured output from tool calls in response.
Conditionally add a parameter to a map if the value is not nil.
Add extended thinking configuration to request body if enabled.
Prepare context and options for :object operations using structured output.
Functions
Extract structured output from tool calls in response.
Used for :object operations to get the final structured output.
Conditionally add a parameter to a map if the value is not nil.
Add extended thinking configuration to request body if enabled.
Extended thinking doesn't work when tool_choice forces a specific tool. See: https://docs.claude.com/en/docs/build-with-claude/extended-thinking
Prepare context and options for :object operations using structured output.
Creates a synthetic "structured_output" tool and forces tool choice to use it. This leverages Claude's tool-calling for structured JSON output.