Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dynamicwebpaige
Copy link
Contributor

Also updated the README. :)

> ([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).
Copy link

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 ;)

pamorgan
pamorgan previously approved these changes Apr 12, 2025
Copy link
Collaborator

@pamorgan pamorgan left a 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) {
Copy link
Collaborator

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?

@Annhiluc Annhiluc added the status: awaiting user response Awaiting a response from the author label May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting user response Awaiting a response from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants