Files
litellm/tests
Cesar GarciaandGitHub 8a26033a4b fix(vertex_ai): convert image URLs to base64 in tool messages for Anthropic (#19896)
* fix(vertex_ai): convert image URLs to base64 in tool messages for Anthropic

Fixes #19891

Vertex AI Anthropic models don't support URL sources for images. LiteLLM
already converted image URLs to base64 for user messages, but not for tool
messages (role='tool'). This caused errors when using ToolOutputImage with
image_url in tool outputs.

Changes:
- Add force_base64 parameter to convert_to_anthropic_tool_result()
- Pass force_base64 to create_anthropic_image_param() for tool message images
- Calculate force_base64 in anthropic_messages_pt() based on llm_provider
- Add unit tests for tool message image handling

* chore: remove extra comment from test file header
2026-01-28 19:42:51 -08:00
..
2026-01-28 14:54:58 -08:00
2026-01-20 18:37:56 +05:30
2026-01-22 10:50:23 -08:00
2026-01-22 15:21:44 -08:00
2026-01-24 13:17:32 -08: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.