Files
litellm/tests/test_litellm/llms/anthropic
Krish Dholakia 9582c88eab Non-anthropic (gemini/openai/etc.) models token usage returned when calling /v1/messages (#12184)
* fix(proxy_server.py): handle empty config yaml

Fixes https://github.com/BerriAI/litellm/issues/12163

* fix(gemini/common_utils.py): replace models/ as expected, instead of using 'strip'

Fixes https://github.com/BerriAI/litellm/issues/12160

* fix(anthropic/experimental_pass_through/messages/transformation.py): check for env var when selecting api key

* fix(anthropic/transformation.py): return tool_use content block start on anthropic bridge

Closes https://github.com/BerriAI/litellm/issues/12158

* fix(anthropic/streaming_iterator.py): fix setting index in block

ensure index is set just once and increments correctly when a new block is created

* fix(anthropic/adapters/handler.py): update logging obj with stream options value if set

* feat(anthropic/streaming_iterator.py): return usage from chat completion to messages bridge

enables usage tracking for non-anthropic models

Closes https://github.com/BerriAI/litellm/issues/12132

* fix(streaming_iterator.py): safely access usage chunk

* fix: suppress linting error

* test: update tests

* fix: fix streaming errors
2025-07-01 17:41:48 -07:00
..