Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds several new FinishReason cases, primarily related to image generation and tool usage, and includes corresponding integration tests. The changes are generally good, but I've identified a minor grammatical error in a documentation comment and a more significant issue in one of the new integration tests. The test for Imagen safety filtering is incorrectly structured and will fail as it doesn't account for an expected error being thrown. I've provided a corrected implementation for the test.
FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds several new FinishReason cases to the SDK, along with corresponding unit and integration tests. The changes to the FinishReason enum and the new integration test for Gemini models are well-implemented. However, I've identified a logical issue in the new Imagen integration test and an opportunity to improve maintainability in the new unit test for decoding finish reasons. My detailed feedback is in the comments below.
FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds several new FinishReason cases to handle more scenarios, particularly around image generation and tool calls. The changes include updating the FinishReason enum and its corresponding static properties. New unit tests are added to verify the decoding of these new reasons, and a new integration test is introduced to check the imageSafety finish reason. The changes are well-implemented and tested. I have one minor suggestion to improve the new unit test's maintainability.
db28e34 to
ff4d080
Compare
ff4d080 to
4a913e4
Compare
PR Review: [AI] Finish Reasons #15931
This PR adds support for new
FinishReasonvalues in the Firebase AI SDK, primarily targeting image generation safety and complex tool-calling scenarios.Summary of Changes
GenerateContentResponse.swift:FinishReason:imageSafety,imageProhibitedContent,imageOther,noImage,imageRecitation,language,unexpectedToolCall,tooManyToolCalls,missingThoughtSignature, andmalformedResponse.GenerateContentIntegrationTests.swift:generateContent_finishReason_imageSafety, an integration test using a "graphic violence" prompt to ensure the SDK correctly identifies safety violations..stopreason or throws a.responseStoppedEarlyerror with the appropriate context.APITests.swift:testFinishReason_decodingto verify that all new reasons are correctly mapped during JSON decoding.CHANGELOG.md: