You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### **PR Description**
This pull request fixes an issue where grounding metadata from the
Google search tool responses was not preserved. It ensures that fields
such as `grounding_supports`, `grounding_chunks`, and
`web_search_queries` are extracted and included in `response_metadata`,
enabling citation tracking and improved traceability in search-augmented
responses.
---
### **Relevant issues**
Fixes#907
---
### **Type**
🐛 Bug Fix
---
### **Changes (optional)**
* Added `_extract_grounding_metadata()` helper function to safely
extract grounding data.
* Updated `_response_to_result()` to include `grounding_supports`,
`grounding_chunks`, and `web_search_queries` in `response_metadata`.
* Preserves backward compatibility with the existing response structure.
---
### **Testing (optional)**
* Manually verified that metadata is preserved across multiple Google
search tool responses.
* Confirmed presence of citation information in augmented responses.
---
### **Note (optional)**
This fix improves the reliability of citations and source tracking in
responses using Google search, supporting downstream systems relying on
structured grounding metadata.
---------
Co-authored-by: Mason Daugherty <[email protected]>
Co-authored-by: Mason Daugherty <[email protected]>
0 commit comments