feat: add support for Gemini (AI Studio) and Gemini Enterprise (Vertex AI)#36
feat: add support for Gemini (AI Studio) and Gemini Enterprise (Vertex AI)#36Ernani Joppert Pontes Martins (ernani) wants to merge 3 commits into
Conversation
PRATHAM KUMAR (rajpratham1)
left a comment
There was a problem hiding this comment.
gemini-enterprise uses GOOGLE_CLOUD_PROJECT as its "API key" environment variable and even writes the entered value into process.env.GOOGLE_CLOUD_PROJECT before constructing ChatGoogle. However, ChatGoogle is instantiated without explicitly passing the project ID, relying on ambient environment state instead. That makes the configuration less predictable and can fail in environments where credentials/project resolution is handled differently. Since this PR introduces first-class Vertex AI support, it would be better to pass the project ID explicitly to ChatGoogle (instead of treating it as an API key env var) and keep the provider configuration aligned with how the SDK expects GCP settings.
|
Hi Ernani Joppert Pontes Martins (@ernani) — thanks for adding Gemini/Vertex support! I put together a small helper PR against your branch that addresses PRATHAM KUMAR (@rajpratham1)'s review: ernani#1 (base It:
Same package (no new dependency), and the |
|
HI Ernani Joppert Pontes Martins (@ernani) - sorry for getting to this PR late. would you mind rebasing your changes? |
|
Thank you for the PR. Closing to support this via #154. |
|
Hi Colin Francis (@colifran) I am glad to see that this evolved in such a rapid pace! I've had some 10 days vacation and I can see how far this went through! Glad to collaborate and benefit all Gemini users with Openwiki! Thanks for catching up this PR! |
Hello! This PR adds native support for the Google Gemini API providers:
gemini(Google AI Studio): For developer-focused setups usingGEMINI_API_KEY.gemini-enterprise(Gemini Enterprise Agent Platform / Vertex AI): For enterprise setups using GCP Application Default Credentials (ADC) and Project ID (GOOGLE_CLOUD_PROJECT), encouraging secure credential management.Key features of this implementation:
@langchain/googlepackage, resolving both providers under the same SDK.~/.openwiki/.env.gemini-3.5-flash,gemini-3.1-pro-preview,gemini-3.0-flash,gemini-3.0-pro,gemini-2.5-pro) and avoids deprecated versions.This implementation builds upon the goals discussed in #29, providing a more robust, secure, and production-ready solution that accommodates enterprise cloud environments.
Closes #29