You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using litellm to call anthropic models that support vision modality with unsupported image format say "pdf", then litellm returns litellm.APIConnectionError with status code 500 where as it should be handled as 400.
Detailed stack:
APIConnectionError: Unsupported image format: pdf. Supported formats: ['png', 'jpeg', 'gif', 'webp']\nTraceback (most recent call last):\n
File \"/Users/trylitellm/.venv/lib/python3.11/site-packages/litellm/main.py\", line 2464, in completion\n response = bedrock_converse_chat_completion.completion(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File \"/Users/trylitellm/.venv/lib/python3.11/site-packages/litellm/llms/bedrock/chat/converse_handler.py\", line 302, in completion\n _data = AmazonConverseConfig()._transform_request(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File \"/Users/trylitellm/.venv/lib/python3.11/site-packages/litellm/llms/bedrock/chat/converse_transformation.py\", line 257, in _transform_request\n bedrock_messages: List[MessageBlock] = _bedrock_converse_messages_pt(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File \"/Users/trylitellm/.venv/lib/python3.11/site-packages/litellm/llms/prompt_templates/factory.py\", line 2401, in _bedrock_converse_messages_pt\n _part = _process_bedrock_converse_image_block( # type: ignore\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
File \"/Users/trylitellm/.venv/lib/python3.11/site-packages/litellm/llms/prompt_templates/factory.py\", line 2204, in _process_bedrock_converse_image_block\n raise ValueError(\nValueError: Unsupported image format: pdf. Supported formats: ['png', 'jpeg', 'gif', 'webp']\n
Relevant log output
No response
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered:
rachitchauhan43
changed the title
[Bug]: Litellm reports 500 instead of 400 when making call to anthropic.claude-3-haiku-20240307 for vision with unsupported type.
[Bug]: Litellm reports 500 instead of 400 when making call to anthropic.claude-3-haiku for vision with unsupported type.
Oct 13, 2024
What happened?
When using litellm to call anthropic models that support vision modality with unsupported image format say "pdf", then litellm returns
litellm.APIConnectionError
with status code 500 where as it should be handled as 400.Detailed stack:
Relevant log output
No response
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: