litellm/tests/pass_through_unit_tests
Krish Dholakia 039c8a922c
Azure api_version="preview" support + Bedrock cost tracking via Anthropic /v1/messages (#13072)
* fix(azure/chat/gpt_transformation.py): support api_version="preview"

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

* Fix anthropic passthrough logging handler model fallback for streaming requests (#13022)

* fix: anthropic passthrough logging handler model fallback for streaming requests

- Add fallback logic to retrieve model from logging_obj.model_call_details when request_body.model is empty
- Fixes issue #12933 where streaming requests to anthropic passthrough endpoints would crash due to missing model field
- Ensures downstream logging and cost calculation work correctly for all streaming scenarios
- Maintains backwards compatibility with existing non-streaming requests

* test: add minimal tests for anthropic passthrough logging handler model fallback

- Add unit tests for the model fallback logic in _handle_logging_anthropic_collected_chunks
- Test existing behavior when request_body.model is present
- Test fallback logic when request_body.model is empty but logging_obj.model_call_details has model
- Test edge cases where both sources are empty or missing
- Ensure backwards compatibility and graceful degradation

* fix(anthropic_passthrough_logging_handler.py): add provider to model name (accurate cost tracking)

* fix(anthropic_passthrough_logging_handler.py): don't reset custom llm provider, if already set

* fix: fix check

---------

Co-authored-by: Haggai Shachar <haggai.shachar@backline.ai>
2025-07-29 08:13:55 -07:00
..
base_anthropic_unified_messages_test.py [Bug Fix] Cost tracking and logging via the /v1/messages API are not working when using Claude Code (#11928) 2025-06-20 18:08:35 -07:00
test_anthropic_messages_passthrough.py Azure api_version="preview" support + Bedrock cost tracking via Anthropic /v1/messages (#13072) 2025-07-29 08:13:55 -07:00
test_assemblyai_unit_tests_passthrough.py (QA+UI) - e2e flow for adding assembly ai passthrough endpoints (#8337) 2025-02-06 18:27:54 -08:00
test_custom_logger_passthrough.py [Feat] Pass through endpoints - ensure PassthroughStandardLoggingPayload is logged and contains method, url, request/response body (#10194) 2025-04-21 19:46:22 -07:00
test_pass_through_unit_tests.py fixes for pass through tests 2025-06-18 21:47:37 -07:00
test_unit_test_anthropic_pass_through.py (Bug Fix) - Accurate token counting for /anthropic/ API Routes on LiteLLM Proxy (#8880) 2025-02-27 15:43:03 -08:00
test_unit_test_passthrough_router.py test: migrate testing 2025-03-22 12:48:53 -07:00
test_unit_test_streaming.py [Feat] Pass through endpoints - ensure PassthroughStandardLoggingPayload is logged and contains method, url, request/response body (#10194) 2025-04-21 19:46:22 -07:00