Repository navigation
fix(google): enable Vertex AI in Gemini TTS for GOOGLE_GENAI_USE_VERTEXAI=1 - #2871
Open
ninglinLiu wants to merge 2 commits into
Open
ninglinLiu wants to merge 2 commits into
ninglinLiu wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: b5fc2a2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Google plugin reads
GOOGLE_GENAI_USE_VERTEXAIin three places, and they disagree.LLMand the realtime model enable Vertex AI fortrueor1, which is also what the plugin README documents ("Set totrueor1to enable Vertex AI"). The beta GeminiTTSonly checked for'true', so withGOOGLE_GENAI_USE_VERTEXAI=1it silently used the Gemini Developer API instead: it threwAPI key is required ... GOOGLE_API_KEYwhen no API key was set, or sent requests to the Developer API instead of the configured Vertex project.While checking the env vars, the README also lists
GOOGLE_GENAI_API_KEYas an alternative toGOOGLE_API_KEY, but no code in the plugin reads it.LLM,TTSand the realtime model all fall back toGOOGLE_API_KEYonly and throw if it is unset, so a user following the README with onlyGOOGLE_GENAI_API_KEYset gets an error.Changes Made
plugins/google/src/beta/gemini_tts.ts: accept'true'or'1'forGOOGLE_GENAI_USE_VERTEXAI, the same check asllm.tsandrealtime_api.ts.plugins/google/README.md: list onlyGOOGLE_API_KEYas the API key env var.Pre-Review Checklist
llm.tsandrealtime_api.tsTesting
gemini_tts.test.ts:GOOGLE_GENAI_USE_VERTEXAI=trueand=1create a Vertex AI client for the configured project, and an unset value uses the API key. The=1case fails onmainand passes with this change.vitest run plugins/google/src/beta/gemini_tts.test.ts: 21 passed, 1 skipped (the live-provider test)