Skip to content
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

[Vertex AI] Log warning for unsupported model names #14610

Merged
merged 5 commits into from
Mar 24, 2025

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.

This comment was marked as resolved.

Copy link

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants