Skip to content

🚀 [firebase_ai] Support for advanced Schema features with $ref and $def #17551

@jacobsimionato

Description

@jacobsimionato

There are some advanced JSON features like $ref and $def which allow for hierarchical structures etc.

They unlock a lot of powerful use cases, but they're not possible with Firebase AI logic right now. I think the two things we need are:

1. Support responseJsonSchema field in the API

Gemini can understand advanced schemas, but only when using the responseJsonSchema parameter rather than responseSchema (see GenerationConfig).

I believe Firebase AI Logic currently only supports responseSchema - see

Map<String, Object?> toJson() => {

2. Support $ref and $def in Schema

Currently, Firebase's schema object does not support representing $ref and $def, so I think we'd need some support here.

See

// you may not use this file except in compliance with the License.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionThis issue needs maintainer attention.plugin: ailabel issues for firebase_ai plugintype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions