Skip to content

Conversation

@andrewheard
Copy link
Contributor

@andrewheard andrewheard commented Mar 24, 2025

Added a warning message to the initializers of GenerativeModel and ImagenModel that is logged when the provided model name does not start with the expected prefix ("gemini-" for GenerativeModel and "imagen-" for ImagenModel). The warning message includes a link to the documentation for supported models.

Note: No error is thrown in case the naming scheme is changed in the future, though we would want to update the logic/message at that time.

…Model initializers. This change adds a warning message to the initializers of GenerativeModel and ImagenModel. The warning is logged when the provided model name does not start with the expected prefix ("gemini-" for GenerativeModel and "imagen-" for ImagenModel). The warning message includes a link to the documentation for supported models. The changes were tested manually, but automated tests could not be run due to an unavailable test environment.
@gemini-code-assist

This comment was marked as resolved.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 introduces a warning message when the provided model name does not start with the expected prefix for GenerativeModel and ImagenModel. This is a good addition to help developers use the SDK correctly. The implementation is clear and straightforward.

Merge Readiness

The code changes are well-implemented and the added warning messages will be helpful for developers. I don't see any issues that would block merging this pull request, but as always, I am unable to directly approve the pull request and recommend that others review and approve this code before merging.

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@andrewheard andrewheard marked this pull request as ready for review March 24, 2025 20:50
@andrewheard andrewheard merged commit 5dcf7aa into main Mar 24, 2025
37 checks passed
@andrewheard andrewheard deleted the log-unsupported-model-warning branch March 24, 2025 22:02
rlazo added a commit to firebase/firebase-android-sdk that referenced this pull request Mar 25, 2025
Added a warning message to the initializers of GenerativeModel and ImagenModel that is logged when the provided model name does not start with the expected prefix ("gemini-" for GenerativeModel and "imagen-" for ImagenModel). The warning message includes a link to the documentation for supported models. Note: No error is thrown in case the naming scheme is changed in the future, though we would want to update the logic/message at that time. Related iOS PR firebase/firebase-ios-sdk#14610
rlazo added a commit to firebase/firebase-android-sdk that referenced this pull request Mar 25, 2025
Added a warning message to the initializers of GenerativeModel and ImagenModel that is logged when the provided model name does not start with the expected prefix ("gemini-" for GenerativeModel and "imagen-" for ImagenModel). The warning message includes a link to the documentation for supported models. Note: No error is thrown in case the naming scheme is changed in the future, though we would want to update the logic/message at that time. Related iOS PR firebase/firebase-ios-sdk#14610
tejasd pushed a commit to firebase/firebase-android-sdk that referenced this pull request Apr 1, 2025
Added a warning message to the initializers of GenerativeModel and ImagenModel that is logged when the provided model name does not start with the expected prefix ("gemini-" for GenerativeModel and "imagen-" for ImagenModel). The warning message includes a link to the documentation for supported models. Note: No error is thrown in case the naming scheme is changed in the future, though we would want to update the logic/message at that time. Related iOS PR firebase/firebase-ios-sdk#14610
@firebase firebase locked and limited conversation to collaborators Jul 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

2 participants