-
Notifications
You must be signed in to change notification settings - Fork 63
Fix dangling references to AiClient. #490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| host: _genUiConversation.genUiManager.host, | |
| host: _genUiConversation.genUiManager, |
| ); | ||
| _uiAgent = UiAgent( | ||
| aiClient: _aiClient, | ||
| aiClient: _contentGenerator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| aiClient: _contentGenerator, | |
| contentGenerator: _contentGenerator, |
Description
Replace references to AiClient with the appropriate replacement.
Fixes #489