Skip to content

Conversation

@SmartDever02
Copy link

@SmartDever02 SmartDever02 commented Jan 6, 2026

Summary

  • 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.

Manual Verification

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Closes #11490

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=102175066

- 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
@DeJeune
Copy link
Contributor

DeJeune commented Jan 6, 2026

Could you please run pnpm prettier-fix and pnpm changeset? Also, it would be great to update the related docs. Thanks!

…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
@SmartDever02
Copy link
Author

Could you please run pnpm prettier-fix and pnpm changeset? Also, it would be great to update the related docs. Thanks!

I did prettier fix and updated related docs, but I am not familiar with changeset, could you guide on changeset if you dont mind?

@DeJeune
Copy link
Contributor

DeJeune commented Jan 6, 2026

Could you please run pnpm prettier-fix and pnpm changeset? Also, it would be great to update the related docs. Thanks!

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

changest is an interactive semantic versioning tool—simply select (press Space) the packages you’ve modified, then (press Enter) proceed to the patch version interface and input your change summary.

@SmartDever02
Copy link
Author

Could you please run pnpm prettier-fix and pnpm changeset? Also, it would be great to update the related docs. Thanks!

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

changest is an interactive semantic versioning tool—simply select (press Space) the packages you’ve modified, then (press Enter) proceed to the patch version interface and input your change summary.

thanks for your reply, then what's major bump vs minor bump?

@DeJeune
Copy link
Contributor

DeJeune commented Jan 6, 2026

bump patch normally

@SmartDever02
Copy link
Author

bump patch normally

bump patch normally

done 🥳

@SmartDever02
Copy link
Author

can you please check this pr? @lgrammel @nicoalbanese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generateImage() supports URLs

2 participants