Skip to content

Conversation

@bjorndonald
Copy link
Contributor

@bjorndonald bjorndonald commented Nov 24, 2025

Description

This PR updates the documentation in the genui package README to reflect recent API changes in the FirebaseAiContentGenerator constructor.

Changes:

  • Added the catalog parameter showing how to provide CoreCatalogItems.asCatalog() to the content generator
  • Replaced tools parameter with additionalTools parameter to better reflect the current API structure
  • Added inline documentation comment explaining the additionalTools parameter schema

These documentation updates ensure that developers following the "Getting Started" guide will use the correct, current API when integrating GenUI into their Flutter applications.

Why these changes:
The API structure has evolved to separate core catalog items from additional tools, making it clearer how to configure the content generator. This documentation update ensures pub.dev shows the correct usage pattern.

Pre-launch Checklist

  • [y] I read the [Flutter Style Guide] recently, and have followed its advice.
  • [y] I signed the [CLA].
  • [y] I read the [Contributors Guide].
  • [y] I have added sample code updates to the [changelog].
  • I updated/added relevant documentation (doc comments with ///).

Fixes #572

@google-cla
Copy link

google-cla bot commented Nov 24, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@bjorndonald bjorndonald marked this pull request as draft November 24, 2025 16:12
@bjorndonald bjorndonald marked this pull request as ready for review November 24, 2025 16:12
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to align with recent API changes in FirebaseAiContentGenerator. The changes are accurate, but I've identified a couple of areas in the README where comments could be clearer or are outdated. My suggestions aim to improve the clarity and correctness of the documentation for developers using the library.

_genUiManager = GenUiManager(catalog: CoreCatalogItems.asCatalog());
// Create a ContentGenerator to communicate with the LLM.
// Provide system instructions and the tools from the GenUiManager.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This comment is now outdated. The code no longer passes tools from _genUiManager. The core UI tools are now inferred from the catalog parameter within FirebaseAiContentGenerator. You should update this comment to reflect the current implementation.

Suggested change
// Provide system instructions and the tools from the GenUiManager.
// Provide system instructions and any additional tools.

Comment on lines 178 to 180
additionalTools: [
// Additional tools to be provided to the AI model. Schema [AiTool] (required String name, required String description, Schema? parameters, String? prefix)
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Placing a long comment inside an empty list can be hard to read. It would be more conventional and readable to place the explanatory comments above the additionalTools parameter.

Suggested change
additionalTools: [
// Additional tools to be provided to the AI model. Schema [AiTool] (required String name, required String description, Schema? parameters, String? prefix)
],
// Additional tools to be provided to the AI model. The schema for an AiTool is:
// required String name, required String description, Schema? parameters, String? prefix
additionalTools: [],

Copy link
Collaborator

@jacobsimionato jacobsimionato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for fixing the documentation here!

''',
tools: _genUiManager.getTools(),
additionalTools: [
// Additional tools to be provided to the AI model. Schema [AiTool] (required String name, required String description, Schema? parameters, String? prefix)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the 'additionalTools' parameter from the example here, seeing as it's not necessary for the most simple setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I have push the change.

@jacobsimionato jacobsimionato merged commit 9280fc0 into flutter:main Dec 1, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing methods inside GenUI Manager.

2 participants