Skip to content

Conversation

@gspencergoog
Copy link
Collaborator

@gspencergoog gspencergoog commented Nov 3, 2025

Description

Replace references to AiClient with the appropriate replacement.

Fixes #489

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 is a large refactoring to rename AiClient to ContentGenerator and FirebaseAiClient to FirebaseAiContentGenerator. The changes are mostly correct and applied consistently across the codebase and documentation. However, I've found a few issues, including a critical error in an example in the main README.md that would prevent it from running, an inconsistency in the API of UiAgent shown in another README, and some minor issues in the documentation files. My review includes suggestions to fix these issues.

if (type == MessageType.genUi) {
return GenUiSurface(
host: _genUiConversation.host,
host: _genUiConversation.genUiManager.host,
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The property host does not exist on GenUiManager. The GenUiManager instance itself is the GenUiHost that should be passed to the GenUiSurface. You can either use _genUiConversation.host which is a getter for genUiManager, or access _genUiConversation.genUiManager directly.

Suggested change
host: _genUiConversation.genUiManager.host,
host: _genUiConversation.genUiManager,

);
_uiAgent = UiAgent(
aiClient: _aiClient,
aiClient: _contentGenerator,
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The UiAgent constructor is still using the aiClient parameter name, which is inconsistent with the rest of the refactoring where AiClient has been replaced by ContentGenerator and the parameter is named contentGenerator. For consistency across the API, consider renaming this parameter in the UiAgent class as well.

Suggested change
aiClient: _contentGenerator,
contentGenerator: _contentGenerator,

@gspencergoog gspencergoog requested review from jacobsimionato and removed request for jacobsimionato November 3, 2025 17:06
@jacobsimionato jacobsimionato merged commit 34acb73 into flutter:main Nov 3, 2025
20 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.

Remnents of AiClient still around

2 participants