Expand description
Shared provider helpers, grouped by responsibility behind stable imports.
Functionsยง
- execute_
token_ count_ request - Execute an exact token-count request when provider endpoint is available.
Returns
Ok(None)when endpoint appears unsupported. - extract_
reasoning_ text_ from_ detail_ values - extract_
reasoning_ text_ from_ serialized_ details - forward_
prompt_ cache_ with_ state - make_
anthropic_ thinking_ config - Generates the interleaved thinking configuration for Anthropic models. This provides consistent thinking configuration across all Anthropic provider implementations.
- parse_
prompt_ tokens_ from_ count_ response - Parse prompt/input token counts from common response shapes.
- strip_
generation_ controls_ for_ token_ count - Remove generation-only controls from a payload before exact prompt-token counting. Token-count endpoints generally require only prompt-side fields.