-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Added fallback logic for detecting file content-type when S3 returns generic #15635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added fallback logic for detecting file content-type when S3 returns generic #15635
Conversation
|
Someone is attempting to deploy a commit to the CLERKIEAI Team on Vercel. A member of the Team first needs to authorize it. |
|
@krrishdholakia Could you help review and merge this PR? |
|
@ishaan-jaff Could you help review and merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
| ) | ||
|
|
||
| # Fallback logic when content-type is missing or generic | ||
| if not content_type or content_type in ["binary/octet-stream", "application/octet-stream"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have this be a helper in litellm_core_utils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, updated.
Thank you!
…om/langpingxue/litellm into litellm_image_content_type_enhance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Problem
When using Bedrock with S3-hosted files, if the S3 object's Content-Type is not correctly set (e.g.,
binary/octet-streaminstead ofimage/png), Bedrock fails to recognize the files format.Solution
Implemented two-tier fallback mechanism:
.png→image/png)Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🆕 New Feature
Changes
BedrockImageProcessor._post_call_image_processing()to add fallback logicNew test passing locally