-
Notifications
You must be signed in to change notification settings - Fork 306
Added an error message to nudge folks to the new SDK. #461
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
base: main
Are you sure you want to change the base?
Added an error message to nudge folks to the new SDK. #461
Conversation
> ([github](https://github.com/googleapis/js-genai/tree/main)), is currently | ||
> available in a *preview launch* - designed to work with Gemini 2.0 features | ||
> and support both the Gemini API and the Vertex API. | ||
> **IMPORTANT:** This SDK is intended for use with older Gemini models (e.g., Gemini 1.0 Pro, Gemini 1.5 Pro). For access to the latest models, including Gemini 2.0 and Gemini 2.5 Pro, please use the newer SDK available at [https://github.com/googleapis/js-genai](https://github.com/googleapis/js-genai). |
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.
We can use a much stronger message similar to the Python package, see https://github.com/google-gemini/deprecated-generative-ai-python.
For older models, we want to encourage people to use the new SDK. This SDK will be around not to break the existing users. New comers to the old models should also use the new SDK ;)
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.
Please make sure this is not a breaking change
|
||
let finalMessage = `Error fetching from ${url.toString()}: [${response.status} ${response.statusText}] ${originalMessage || 'Server responded with an error.'}`; // Provide default if message is empty | ||
|
||
if (isUnsupportedModelError) { |
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.
this might be a breaking change if user has client side logic to process the error message
. Maybe a safer approach is to log a warning message to the console?
Also updated the README. :)