-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
What feature would you like to see?
It would be great if firebase_ai plugin supported a native JsonPart (or equivalent) when sending prompts to Gemini. The underlying Google AI SDK accepts multipart content, but currently it only allows JSON to be passed as encoded text as a workaround. This forces developers to manually serialize and escape JSON before sending it to the model, which is error-prone and adds a lot of unnecessary boilerplate.
Why would this be useful?
Many real apps using Gemini rely on structured state — user profiles, session context, configs, domain models, etc. Having to wrap JSON in a text part makes prompting fragile, especially with deeply nested objects. A native JSON part would:
- allow us to send structured data directly,
- avoid escaping/formatting issues,
- simplify prompts,
- and align well with Gemini’s structured output and function-calling capabilities.
Is there a missing a feature that is supported on an underlying SDK? Or is there a feature that you think would be useful to have in FlutterFire?
It’s a small feature, but it would greatly improve the developer experience for anyone using Gemini.