-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
Other
Which platforms are affected?
Android
Description
- Missing Mapping of the groundingSupports Property
Status: Critical (Compliance Blocker) The GroundingMetadata class in the firebase_ai package exposes groundingChunks, but completely omits the groundingSupports property.
Observation: While the REST API provides the complete list of supports, the SDK throws a NoSuchMethodError when attempting to access it.
Impact: Developers cannot implement inline citations (superscripts). Since Google mandates these for Grounded Results, the current SDK implementation is effectively non-compliant.
- Inaccuracy of the Delivered Indexes (Word Slicing)
Status: Functional Deficiency. Even when the data is extracted manually (e.g., via a REST call), a structural problem arises in the accuracy of the startIndex and endIndex values.
Problem: The indexes for text segments delivered by the API often end mid-word.
Example: A quote should refer to the phrase "...the Federal Republic of Germany," but the endIndex points to the position before the "d" in "Germany."
Impact: This leads to faulty UI rendering, where words are "sliced" by superscripts. Developers currently have to implement time-consuming workarounds (searching for the nearest whitespace or adjusting regular expressions) to maintain the visual integrity of the text.
Reproducing the issue
?
Firebase Core version
firebase_core: ^4.0.0
Flutter Version
Flutter 3.32.3
Relevant Log Output
NoSuchMethodError: Class 'GroundingMetadata' has no instance getter 'groundingSupports'Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response