-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Allow input of image properties #1337
base: main
Are you sure you want to change the base?
Conversation
Allow image input as a dict[str, str] or a list of dict[str, str] so that image properties, such as `detail` (https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding), can be passed through.
# image url or image base64 | ||
url = image if image.startswith("http") else f"data:image/jpeg;base64,{image}" | ||
if not image_info["url"].startswith("http"): |
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.
doesn't check the image_info field name if passing a dict without url. maybe you should add validation.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1337 +/- ##
==========================================
- Coverage 62.59% 62.56% -0.03%
==========================================
Files 287 287
Lines 17589 17595 +6
==========================================
Hits 11009 11009
- Misses 6580 6586 +6 ☔ View full report in Codecov by Sentry. |
Can you take another look at the comments? |
Features
Allow image input as a dict[str, str] or a list of dict[str, str] so that image properties, such as
detail
(https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding), can be passed through. Theimages
argument in llm.aask() can now be any of these:Influence
The original usage is not affected. The new usage of passing image details is supported.
Result