Repository navigation
Feature/gemini live - #61
Open
juliantoledo wants to merge 2 commits into
Open
juliantoledo wants to merge 2 commits into
juliantoledo wants to merge 2 commits into
Conversation
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.
Title
feat(agent): add Gemini Live (gemini-3.8-live) voice session support for AppFunctions
Description
Summary
Adds real-time bidirectional voice interaction to the Agent Demo screen using the Gemini Live API (
models/gemini-3.8-live), enabling users to invoke Android AppFunctions and internal agent tools by voice while viewing live transcriptions, tool execution status, generated image attachments, andPendingIntentaction confirmation cards directly in the active chat thread.Key Changes
Gemini Live WebSocket Session (
GeminiLiveSessionManager&LiveSessionState):v1betaBidiGenerateContentWebSocket endpoint using KtorWebSockets(DataModule.provideHttpClient) and the configured Gemini API key fromSettingsRepository."models/gemini-3.8-live"withAUDIOresponse modality, input/output audio transcriptions, system instructions, and all enabled AppFunction and internal tool declarations.USERandASSISTANTmessages.Low-Latency PCM Audio I/O (
GeminiLiveAudioHelper):VOICE_COMMUNICATIONwithAcousticEchoCancelerenabled when available) and plays back 24 kHz mono 16-bit PCM model audio viaAudioTrack.AppFunction & Internal Tool Bridge (
AgentOrchestrator&GeminiToolConverter):AgentOrchestrator.getEnabledToolsandAgentOrchestrator.executeLiveToolCallsto execute AppFunctions and internal tools (getCurrentLocation,geocodeAddress,generateImage) during a Live session, updatingAgentStatus.InvokingTool, posting generated image attachments andPendingIntentconfirmation cards to the thread, and returningfunctionResponsesover the WebSocket.GeminiToolConverter.convertForLiveApito normalize tool schemas (enumfield naming and OpenAPI format compatibility) forBidiGenerateContent.Agent Demo UI & Permissions (
AgentDemoScreen,AgentDemoViewModel,AgentUiState,AndroidManifest.xml):RECORD_AUDIOpermission handling and@Appscoping support.LiveSessionIndicatorstatus banner when connecting or listening, and updatedModelDropdownin the top bar to displaygemini-3.8-livewhile a Live session is active.INTERNETandRECORD_AUDIOpermissions inAndroidManifest.xml.Unit Tests:
GeminiLiveSessionManagerTest,GeminiToolConverterTest.convertForLiveApi_normalizesEnumsAndStripsFileReferenceFormat, andAgentDemoViewModelTestcoverage forOnToggleLiveSession.