Skip to content

feat(provider/google): add urlContextMetadata to providerMetadata #7183

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

patelvivekdev
Copy link
Contributor

Background

When using URL context as a tool in streaming, Google sends urlContextMetadata in the first chunk. And because of that, when we try to access it in the last chunk and add in the provider data, we get undefined.

Summary

Save the urlContextMetadata from the first chunk and adding only if we get a new urlContextMetadata

Verification

Tested manually with streamText in ai-core examples

Tasks

  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

Currently, when using google_search and url_context tools combined, we are getting the result, but we are not getting the groundingChunks and the groundingSupports for the URL context in streaming.

This might be a bug from Google's streaming API.

Related Issues

@patelvivekdev patelvivekdev marked this pull request as ready for review July 12, 2025 06:37
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy