Skip to content

Consider merging tool calling loop logic between genui_google_generative_ai and genui_firebase_ai #555

@jacobsimionato

Description

@jacobsimionato

https://github.com/flutter/genui/tree/main/packages/genui_firebase_ai and https://github.com/flutter/genui/tree/main/packages/genui_google_generative_ai have a lot of similar logic, e.g. the tool loop.

Ideally, they would be structured like:

  • genui: contains some LocalAgent utility which implements generic agent loop etc in Dart
  • genui_google_generative_ai implements a thing that can make an inference via the REST API, do conversion of types etc.
  • genui_firebase_ai the same for Firebase AI Logic

Deduplicating this code will allow us to put more effort into the local agent pattern which could be helpful for some customers, because we will centralize this logic. For example, what if we want to abandon tool calling and use regular unstructured output instead, with error correction etc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    front-line-handledCan wait until the second-line triage. The front-line triage already checked if it's a P0.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions