Files
litellm/tests
Niv GoldenbergandGitHub 232d1558dd fix(anthropic-adapter): properly translate Anthropic image format to OpenAI (#16202)
* fix(anthropic-adapter): properly translate Anthropic image format to OpenAI

Fixed bug where images were stripped during Anthropic Messages API to Azure
OpenAI translation. Image source data was being stringified instead of having
fields properly extracted.

- Added _translate_anthropic_image_to_openai() helper method
- Support both base64 and URL image formats per Anthropic API spec
- Refactored user message and tool result image handling

* test(anthropic-adapter): add comprehensive image translation tests

Add 5 unit tests covering image translation from Anthropic to OpenAI format:
- User messages with base64 images
- User messages with URL images
- Tool results with base64 images
- Tool results with URL images
- Mixed content with multiple images
2025-11-03 18:53:44 -08:00
..
2025-10-28 17:38:16 -07:00
2025-11-01 09:21:17 -07:00
2025-10-04 10:57:02 -07:00
2025-10-31 18:06:01 -07:00
2025-10-31 20:32:03 -07:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.