Skip to content

fix(backend): use ai-sdk buffer instead of data url#1410

Merged
surt91 merged 1 commit intomainfrom
fix/ai-sdk-use-image-buffer-instead-of-data-url
Mar 10, 2026
Merged

fix(backend): use ai-sdk buffer instead of data url#1410
surt91 merged 1 commit intomainfrom
fix/ai-sdk-use-image-buffer-instead-of-data-url

Conversation

@surt91
Copy link
Collaborator

@surt91 surt91 commented Mar 10, 2026

After an ai-sdk update the old way led to problems with some models like gpt-5-nano.

See also: https://github.com/vercel/ai/releases/tag/ai%406.0.116

After an ai-sdk update the old way led to problems with some models like gpt-5-nano.
Copilot AI review requested due to automatic review settings March 10, 2026 08:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the files-vision tool to send image inputs to ai-sdk as binary buffers (with explicit MIME types) instead of embedding images as base64 data URLs, addressing compatibility issues introduced after an ai-sdk update (notably with models like gpt-5-nano).

Changes:

  • Convert stored base64-encoded image blobs into Buffer instances (Buffer.from(..., 'base64')) for model input.
  • Update the generateText prompt image parts to pass image as binary data plus mimeType rather than a data URL string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@surt91 surt91 changed the title fix: use ai-sdk buffer instead of data url fix(backend): use ai-sdk buffer instead of data url Mar 10, 2026
@surt91 surt91 merged commit b0d11ea into main Mar 10, 2026
29 checks passed
@surt91 surt91 deleted the fix/ai-sdk-use-image-buffer-instead-of-data-url branch March 10, 2026 08:48
@surt91 surt91 mentioned this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants