-
Notifications
You must be signed in to change notification settings - Fork 311
genai: switch to google-genai sdk where possible #1077
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?
genai: switch to google-genai sdk where possible #1077
Conversation
Google just announced the deprecation of the old libraries November 30th, 2025 |
thanks for the contribution! we're not using the deprecated SDK, so we're good without this change. if you could work on switching |
Thanks for all the hard work! My organization also has a model proxy and has been struggling to use langgraph with gemini for this exact issue. Would love to see this merged in soon - and wouldn't mind helping out if necessary. Wondering if getting the new client codepath flagged would be the easiest way. |
|
Additional guidelines
Changes are backwards compatiblePR Description
Switches the client for
libs/genai
over to https://github.com/googleapis/python-genai. This is probably 95% done but I'd love a contributor's help to make sure I didn't miss anything. I am not sure of the best way to handle keeping both old and new clients in the code and supporting old/new features or if we should remove support for the oldembeddings.py
and switch to the new ones? I know ideally we don't have breaking changes but this seems large enough to warrant a3.x
potentially?The motivation behind this was to add
base_url
and support forREST
in async environments so that this library can be used behind proxies (such aslitellm
, custom coded ones, etc) for tracking and rate-limiting purposes. However, in general, it seems like this is the library that will be supported by Google moving forward anyways.All unit tests and integration tests passed for me locally.
Relevant issues
None
Type
🆕 New Feature
Changes
Switched client over to https://github.com/googleapis/python-genai but had to keep the old client for
embeddings.py
since not everything is supported yet. That may not be an issue though if this is true #1032Note
grpc
, but Google (and the LLM world) seem to agree on REST for thismetadata
oradditional_kwargs
etc oflangchain
Pydantic models where things are just passed through directly