Skip to main content

Module common

Module common 

Source
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.