[Firebase AI] Add support for automatic functions#1426
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces automated function calling for Firebase AI Chat and TemplateChat sessions, enabling the model to automatically invoke local functions. Key additions include the AutoFunctionDeclaration and BaseAutoFunctionDeclaration classes, along with helper logic in ChatSessionHelpers to manage execution turns and history updates. Feedback identifies a critical deadlock risk when using task.Wait() in asynchronous contexts and suggests adding null checks for function delegates. Further improvements are recommended to enhance type safety by avoiding dynamic and to use more idiomatic LINQ for dictionary initialization.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for automated function calling in chat sessions, introducing the AutoFunctionDeclaration class, refactoring message handling into helper classes, and adding configurable turn limits. Feedback identifies a breaking API change in TemplateTool.FunctionDeclaration, missing [EnumeratorCancellation] attributes on async stream methods, and suggestions for improved error handling and constant usage.
Description
Add support for automated function calling in both Chat and TemplateChatSession.
Testing
Running tests locally, with the included new tests.
Type of Change
Place an
xthe applicable box: