-
Notifications
You must be signed in to change notification settings - Fork 49
[Firebase AI] Format the automated tests #1344
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
Summary of ChangesHello @a-maurice, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the code readability and maintainability of the automated test file for Firebase AI by applying consistent formatting rules. The changes are purely stylistic, ensuring that all code blocks, including Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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 focuses on formatting the automated test file UIHandlerAutomated.cs
to use a consistent bracing style. The changes are purely stylistic as described.
My review confirms the formatting changes and also points out a few areas for improvement:
- An
if
statement was missed in the formatting pass, which I've flagged for consistency. - Several hardcoded strings for model names and a magic number for float comparison could be extracted into constants to improve maintainability.
- The
LoadStreamingAsset
method can be simplified usingasync/await
and ausing
block to improve readability and ensure proper resource disposal.
Overall, the formatting is a good step towards consistency. The additional suggestions aim to further improve the code's quality and maintainability.
firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs
Show resolved
Hide resolved
firebaseai/testapp/Assets/Firebase/Sample/FirebaseAI/UIHandlerAutomated.cs
Show resolved
Hide resolved
async Task TestGenerateImage(Backend backend) { | ||
async Task TestGenerateImage(Backend backend) | ||
{ | ||
var model = GetFirebaseAI(backend).GetGenerativeModel("gemini-2.0-flash-exp", |
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 model name "gemini-2.0-flash-exp"
is hardcoded. It would be better to define it as a constant at the top of the class, similar to TestModelName
, to improve maintainability and avoid magic strings. For example: private readonly string TestGenerateImageModelName = "gemini-2.0-flash-exp";
var model = GetFirebaseAI(backend).GetGenerativeModel(TestGenerateImageModelName,
Description
Format the automated test file. This has no functionality change, just formatting.
Testing
Running tests locally
Type of Change
Place an
x
the applicable box: