-
-
Notifications
You must be signed in to change notification settings - Fork 178
Feat(ai-gemini): Gemini Realtime Adapter #405
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
nikas-belogolov
wants to merge
7
commits into
TanStack:main
Choose a base branch
from
nikas-belogolov:feat/gemini-realtime-chat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d4874c6
Added gemini ephemeral realtime token
nikas-belogolov bb7d7b2
added initial realtime adapter
nikas-belogolov 69ae10c
ci: apply automated fixes
autofix-ci[bot] f40f0c8
Merge branch 'main' into feat/gemini-realtime-chat
nikas-belogolov 8d4097f
Added gemini adapter, refactored realtime client
nikas-belogolov dadfae9
Added gemini live option to example
nikas-belogolov 0711441
Fixed refactoring of realtime client
nikas-belogolov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@tanstack/ai-gemini': minor | ||
| --- | ||
|
|
||
| Added Gemini Realtime Adapter |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
π§© Analysis chain
π Web query:
Gemini Live API JavaScript supported responseModalities per session and supported prebuilt voice namesπ‘ Result:
In the Gemini Live API JavaScript SDK (
@google/genai), supported responseModalities are specified as an array in the session config, e.g., responseModalities: [Modality.AUDIO] or [Modality.TEXT]. These are set per session via LiveConnectConfig and determine the output types (AUDIO and/or TEXT) for that session. Native audio models primarily support AUDIO, while others support combinations including TEXT. Supported prebuilt voice names (used in speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName) include 30 HD voices: Zephyr (Bright), Puck (Upbeat, default), Charon (Informative), Kore (Firm), Fenrir (Excitable), Leda (Youthful), Orus (Firm), Aoede (Breezy), Callirrhoe (Easy-going), Autonoe (Bright), Enceladus (Breathy), Iapetus (Clear), Laomedeia (Upbeat), Achernar (Soft), Alnilam (Firm), Schedar (Even), Gacrux (Mature), Pulcherrima (Forward), Sadachbia (Lively), Sadaltager (Knowledgeable), Sulafat (Warm), Umbriel (Easy-going), Erinome (Clear), Achird (Friendly), Algieba (Smooth), Algenib (Gravelly), Zubenelgenubi (Casual), Despina (Smooth), Rasalgethi (Informative), Vindemiatrix (Gentle). These are shared with TTS and configurable per session for audio responses.Citations:
π Script executed:
Repository: TanStack/ai
Length of output: 3793
Update Gemini adapter to use Gemini-compatible voice and responseModalities configuration.
The
geminiRealtime()adapter selected at line 68 is routed through shared defaults below that are incompatible with Gemini Live. Line 92 specifiesvoice: 'alloy'(an OpenAI voice), but Gemini Live only supports 30 prebuilt voices with names likePuck(default),Kore,Aoede, etc. Additionally, Gemini Live requiresresponseModalitiesto be explicitly set per session as an array (e.g.,[Modality.AUDIO]) and only supports a single response modality per session, whereas the current config allows unconstrained modalities. The Gemini branch will fail on connection with these defaults.π€ Prompt for AI Agents