Skip to content

fix(ai): fix missing support for image thought signatures (e.g. for Gemini image models)#13064

Merged
gr2m merged 5 commits intomainfrom
fa-fix-missing-image-thought-signatures
Mar 4, 2026
Merged

fix(ai): fix missing support for image thought signatures (e.g. for Gemini image models)#13064
gr2m merged 5 commits intomainfrom
fa-fix-missing-image-thought-signatures

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

Summary

This fixes a few problems:

  • Image thought signatures were not supported by ai at all when streaming, including in UI / useChat transformations.
  • Image thought signatures were therefore also not being processed when received in a Gemini API response.
  • When using Gemini to produce multimodal output (e.g. text and images together), the order of output parts was not respected - images were always displayed after all text, even when in the original response they were in between text paragraphs.

Manual Verification

Use the new UI example google-gemini-images in examples/ai-e2e-next to verify. Try a prompt like:

Write a 3 verse kids poem about a dog meeting an owl, accompanied by illustrations

Without this PR, you will see all images appear after all text, even though this is not the correct order per the streaming chunks. With this PR, that's fixed.

Similarly, without this PR you will not be able to send any follow up messages - they will error because of the missing image thought signatures. With this PR, it works.

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)

Future Work

N/A

Related Issues

Fixes #12988
Fixes #11461
Fixes #10595

@tigent tigent bot added ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label ai/ui anything UI related bug Something isn't working as documented provider/google Issues related to the @ai-sdk/google provider reproduction provided labels Mar 4, 2026
@felixarntz felixarntz changed the title Fa fix missing image thought signatures fix(ai): fix missing support for image thought signatures (e.g. for Gemini image models) Mar 4, 2026
@gr2m gr2m merged commit 2291047 into main Mar 4, 2026
18 checks passed
@gr2m gr2m deleted the fa-fix-missing-image-thought-signatures branch March 4, 2026 22:25
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 4, 2026

🚀 Published in:

Package Version
ai 6.0.114
@ai-sdk/amazon-bedrock 4.0.75
@ai-sdk/angular 2.0.115
@ai-sdk/anthropic 3.0.56
@ai-sdk/google 3.0.38
@ai-sdk/google-vertex 4.0.75
@ai-sdk/langchain 2.0.120
@ai-sdk/llamaindex 2.0.114
@ai-sdk/react 3.0.116
@ai-sdk/rsc 2.0.114
@ai-sdk/svelte 4.0.114
@ai-sdk/vue 3.0.114

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

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label ai/ui anything UI related bug Something isn't working as documented provider/google Issues related to the @ai-sdk/google provider reproduction provided

Projects

None yet

2 participants