The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test url with format
Ishaan Jaffer5c289df374e4
diff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.pyindex 2a59a0b74f0..ade512d6f65 100644--- a/tests/test_litellm/test_main.py+++ b/tests/test_litellm/test_main.py@@ -198,7 +198,7 @@ async def test_url_with_format_param(model, sync_mode, monkeypatch):if model.startswith("bedrock/invoke/"):# bedrock/invoke should convert URLs to base64 (doesn't support URL references)# URL should NOT be in the JSON (it should be converted to base64)- assert "https://upload.wikimedia.org" not in json_str+ assert "https://awsmp-logos.s3.amazonaws.com" not in json_str# Should have base64 data in the source (type="base64", not type="url")assert '"type":"base64"' in json_str or '"type": "base64"' in json_str# Should have "data" field containing base64 content@@ -206,13 +206,13 @@ async def test_url_with_format_param(model, sync_mode, monkeypatch):elif model.startswith("bedrock/"):# Regular Bedrock models should convert URLs to base64 (uses "bytes" field)# URL should NOT be in the JSON (it should be converted to base64)- assert "https://upload.wikimedia.org" not in json_str+ assert "https://awsmp-logos.s3.amazonaws.com" not in json_str# Should have "bytes" field (Bedrock uses "bytes" not "base64" in the field name)assert '"bytes"' in json_str or '"bytes":' in json_strelif model.startswith("anthropic/"):# Direct Anthropic models should pass HTTPS URLs directly (HTTP URLs are converted to base64)# Since we're using HTTPS URL, it should be passed as-is- assert "https://upload.wikimedia.org" in json_str+ assert "https://awsmp-logos.s3.amazonaws.com" in json_str# For Anthropic, URL references use "url" type, not base64assert '"type":"url"' in json_str or '"type": "url"' in json_strelse: