mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-17 04:34:25 +00:00
* fix(anthropic): count a leading system run through count_tokens' system parameter Anthropic's count_tokens rejects role "system" at the head of messages, so /v1/responses/input_tokens with instructions, and /v1/messages/count_tokens with a system-role message, fell back to the local tokenizer. The shared Anthropic count_tokens transformation now lifts the leading run of system messages into the top-level system parameter, the way the chat path sends it, after any system the caller set. Anthropic direct, Azure AI Anthropic, and Bedrock Mantle share that transformation. * test(integration): cover the count_tokens leading-system lift across Anthropic, Azure AI and Bedrock Mantle --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| files | ||
| messages | ||
| pass_through | ||
| __init__.py | ||
| test_anthropic_common_utils.py | ||
| test_anthropic_count_tokens_transformation.py | ||
| test_anthropic_files_and_batches.py | ||
| test_anthropic_output_format_filter.py | ||
| test_anthropic_prompt_cache_prediction.py | ||
| test_anthropic_reasoning_effort.py | ||
| test_anthropic_schema_filter.py | ||
| test_anthropic_structured_output.py | ||
| test_anthropic_wif.py | ||
| test_azure_ai_cache_pricing.py | ||
| test_cost_calculation_dict_safety.py | ||
| test_count_tokens_oauth.py | ||
| test_message_sanitization.py | ||