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 introduces support for image generation configuration in the Gemini API, including new FinishReason enum values for image-related stop conditions and the addition of the ImageConfig class with its associated ImageAspectRatio and ImageSize enums. The GenerationConfig has been updated to include an imageConfig field, and corresponding unit tests have been added to verify serialization and parsing. The feedback focuses on adhering to the project's style guide by using const constructors for the new immutable configuration classes and their instances in tests.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for image generation configuration in the Gemini API, including new ImageConfig, ImageAspectRatio, and ImageSize types, as well as several new FinishReason enum values. The changes include necessary JSON serialization logic and updated unit tests. Feedback was provided regarding a minor typo in a documentation comment and a recommendation to use package:checks for new test assertions to align with the repository's style guide.
| group('ImageConfig', () { | ||
| test('toJson with all fields', () { | ||
| const config = ImageConfig( | ||
| aspectRatio: ImageAspectRatio.portrait9x16, | ||
| imageSize: ImageSize.size2K, | ||
| ); | ||
| expect(config.toJson(), { | ||
| 'aspectRatio': '9:16', | ||
| 'imageSize': '2K', | ||
| }); | ||
| }); | ||
|
|
||
| test('toJson with some fields null', () { | ||
| const config = ImageConfig( | ||
| aspectRatio: ImageAspectRatio.landscape16x9, | ||
| ); | ||
| expect(config.toJson(), { | ||
| 'aspectRatio': '16:9', | ||
| }); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
The repository style guide (line 69) recommends using package:checks for assertions instead of package:test's expect. While the existing tests use expect, new tests should ideally follow the updated guidelines.
References
- Use package:checks for assertions. (link)
There was a problem hiding this comment.
Keeping expect to be consistent with rest of file.
Replicating changes from iOS SDK for ImageConfig and expanded FinishReasons.