-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(generateImage): add support for URL-based image responses #11565
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
base: main
Are you sure you want to change the base?
feat(generateImage): add support for URL-based image responses #11565
Conversation
- Update openaiImageResponseSchema and openaiCompatibleImageResponseSchema to accept url field alongside b64_json - Modify OpenAI and OpenAI-compatible providers to return URLs when present in API responses - Add experimental_download parameter to generateImage function for custom URL download handling - Implement URL detection and automatic downloading in generateImage when images are returned as URLs - Add comprehensive tests for URL handling, mixed base64/URL responses, and download functionality This change enables generateImage() to work with image-generation endpoints that return images as URLs instead of base64-encoded strings, automatically downloading and converting them to GeneratedFile format. Closes vercel#11490
|
Could you please run |
This reverts commit 36dda2c.
…l_download - Document automatic URL detection and downloading in generateImage - Add experimental_download parameter to API reference - Include code examples for custom download function usage - Explain how generateImage handles both base64 and URL responses
I did prettier fix and updated related docs, but I am not familiar with changeset, could you guide on changeset if you dont mind? |
https://youtu.be/LpsHhCqCElQ?t=274&si=fC6V_MPnLhgUv9iH
|
thanks for your reply, then what's major bump vs minor bump? |
|
bump patch normally |
done 🥳 |
|
can you please check this pr? @lgrammel @nicoalbanese |
Summary
This change enables generateImage() to work with image-generation endpoints that return images as URLs instead of base64-encoded strings, automatically downloading and converting them to GeneratedFile format.
Manual Verification
Checklist
pnpm changesetin the project root)Related Issues
Closes #11490
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=102175066