-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix openai image schema bug #1268
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Description updated to latest commit (82b4be5)
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Review 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
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 #1268 +/- ##
==========================================
- Coverage 70.22% 70.20% -0.03%
==========================================
Files 316 316
Lines 18860 18860
==========================================
- Hits 13245 13240 -5
- Misses 5615 5620 +5 ☔ View full report in Codecov by Sentry. |
lgtm |
User description
I try to run android assistant with gpt-4-turbo, but there was an error indicating the messages schema was incorrect:
"Invalid type for 'messages[1].content[1].image_url': expected an object, but got a string instead
by checking the openai-sdk doc https://platform.openai.com/docs/guides/vision and https://platform.openai.com/docs/api-reference/chat/create
"I found that the format {"type":"image_url","image_url":YOUR_IMAGE_URL} can be used on gpt-4-vision-preview, but not on gpt-4-turbo, whereas the format {"type":"image_url","image_url":{"url":YOUR_IMAGE_URL}} can be used on both."
Consequently, I update the schema for more compability.