gemini_live 2026.9.20
gemini_live: ^2026.9.20 copied to clipboard
A Flutter package for the Gemini Live API, enabling real-time, multimodal conversations with Google's Gemini models.
2026.9.20 #
Added #
- Gemini Voices API Integration & Support:
- Added
GeminiVoicesService(accessible viagenAI.voicesor standalone) for managing custom and prebuilt system voice catalog resources (listVoices,createVoice,getVoice,deleteVoice). - Added
VoiceResourcemodel supporting custom Google-managed voices, client-managed replication keys, and prebuilt catalog voices. - Added
CreateVoiceRequestsupporting natural-language prompted voices (CreateVoiceRequest.prompted) and audio-cloned replicated voices (CreateVoiceRequest.replicated). - Added
VoiceType(replicated,prompted,prebuilt),VoicePitch(low,medium,high),PromptedVoice,ReplicatedVoice,VoiceAudioData,ListVoicesResponse, andDeleteVoiceResponsedata models.
- Added
- VoiceConfig & SpeechConfig Enhancements:
- Added
VoiceConfig.voicestring property to directly pass custom voice IDs (voice_...), replication keys (voicekey_...), or prebuilt voice names directly into speech synthesis. - Added
VoiceConfig.promptedVoiceConfigsupport for natural-language designed voices. - Added ergonomic constructors:
VoiceConfig.fromVoiceName(String name)andVoiceConfig.fromVoiceId(String id). - Added
SpeechConfig.voiceproperty andSpeechConfig.fromVoice(String voiceNameOrId, {String? languageCode})convenience factory.
- Added
- Upstream Sync & Documentation:
- Synced with upstream
js-genaiandpython-genaidiscovery doc and Voices API resource updates. - Updated
AudioTranscriptionConfig.languageCodesdocumentation reflecting current upstream preference over deprecatedlanguageHints/languageAuto.
- Synced with upstream
2026.9.19 #
Added #
- Real-time Token Usage & Cost Tracking:
- Added
GeminiTokenUsageTracker: Automatically tracks real-time prompt, candidate, thoughts, audio, video, image, and document token consumption per turn and session with model-specific cost estimation. - Added
GeminiLiveUsageBadge: Sleek Material widget showing live token count and estimated cost, with interactive tap dialog (GeminiLiveUsageDetailsDialog) showing full multi-modal breakdowns.
- Added
- Upstream Sync with
js-genai2.23.0 &python-genai2.24.0:- Added
TrafficType.ON_DEMAND_OFFPEAK('ON_DEMAND_OFFPEAK') enum value. - Synced Live SDK request headers and user-agent string to
google-genai-sdk/2.23.0. - Regenerated code generation artifacts (
models.g.dart).
- Added
- Example App Enhancements:
- Integrated
GeminiLiveUsageBadgeacross live demo pages. - Added Live Media Subtitle & Live Smart Notetaker workflows.
- Integrated
- Removed legacy
experimentaldesignation across package metadata and documentation to reflect the official Stable release of the Gemini Live API.
2026.9.16 #
Added #
- Gemini 3.8 Live & Extended Thinking Support:
- Added
LiveModelsclass providing canonical model identifiers:LiveModels.gemini38Live('gemini-3.8-live'): Default stable Live API model for low-latency voice and multimodal dialogue without reasoning-induced delays.LiveModels.gemini38LiveExtendedThinking('gemini-3.8-live-extended-thinking'): High-reasoning Live model for voice interactions requiring deep background reasoning.LiveModels.gemini31FlashLivePreview('gemini-3.1-flash-live-preview'): Previous preview model.LiveModels.gemini25FlashNativeAudioPreview('gemini-2.5-flash-native-audio-preview-12-2025').
- Added
- Example App Updates:
- Set default model to
gemini-3.8-liveinApiKeyStoreandLiveAPIDefaults. - Added
gemini-3.8-liveandgemini-3.8-live-extended-thinkingto model selection lists across all demo pages. - Updated connection logging to display active Gemini 3.8 Live model code.
- Set default model to
- Documentation & Guides:
- Updated
README.md,README_KR.md,README_JP.md, andREADME_ZH.mdwith official Gemini 3.8 Live models. - Added Supported Live Models table to
doc/api_reference.md. - Added Section 10: Gemini 3.8 Live Migration & Best Practices in
doc/advanced_configuration.mdcovering model selection, omittingthinking_levelongemini-3.8-live, default non-blocking function execution, and completion tracking viaLiveServerContent.isInteractionComplete. - Updated AI Agent Skill definition (
SKILL.md) to guide assistant models with Gemini 3.8 Live patterns.
- Updated
2026.9.11 #
Added #
- Added
LiveServerContent.isInteractionCompletegetter aligned with upstreampython-genai2.23.0 interaction lifecycle logic:- If
interactionStatusis specified, evaluates whether the status has settled toInteractionStatus.IDLE. - Otherwise, cleanly falls back to
turnComplete == true. - Makes handling multi-turn conversational chunking, tool call completion, and live agent turn boundaries significantly more ergonomic for Flutter developers.
- If
Changed #
- Synced Gemini Live SDK request headers and user-agent string to
google-genai-sdk/2.22.0(aligned with upstreamjs-genai2.22.0). - Bumped package version to
2026.9.11.
Tested #
- Added unit tests for
LiveServerContent.isInteractionCompleteacross all permutations (turnComplete,interactionStatustransitions).
2026.9.9 #
Added #
- Synced DTOs and features with
js-genaiversions 2.17.0 through 2.21.0 andpython-genai2.17.0 through 2.22.0 (changes through September 2026):InteractionStatusenum (UNSPECIFIED,IN_PROGRESS,@Deprecated('Use IDLE instead.') REQUIRES_ACTION,IDLE) representing the live session activity status.LiveServerContent.interactionStatusproperty sent by the server alongsideturnComplete.MediaProcessingenum (MEDIA_PROCESSING_UNSPECIFIED,STATIC,AGENTIC) andPart.mediaProcessingfield indicating how input media is processed.AudioTranscriptionConfigModeenum (MODE_UNSPECIFIED,VERBATIM,SMART) andAudioTranscriptionConfig.modefield for configuring smart disfluency removal and formatting.ToolParallelAiSearchmodel class andTool.parallelAiSearchfield (supported in enterprise agent platform grounding).ToolType.MEDIA_PROCESSINGenum value.ServiceTier.DEFERRED('deferred') enum value inServiceTier.AuthToken,LiveConnectConstraints, andCreateAuthTokenConfigDTO classes for ephemeral token constraints and configuration (expireTime,newSessionExpireTime,uses).
- Reusable Flutter Material Widgets:
GeminiLiveStatusBadge&GeminiLiveStatusBadge.fromFlags(): Real-time visual badge tracking connection state andInteractionStatuswith animated pulsing indicators.GeminiLiveMicButton: Interactive microphone button with animated ripple effects during voice recording.GeminiLiveVoiceIndicator: Lightweight waveform audio bar visualizer animating rhythmically when speech or streaming is active.
- Example App Updates:
- Integrated
GeminiLiveStatusBadge,GeminiLiveMicButton, andGeminiLiveVoiceIndicatorintoLiveAPIDemoPage,ChatPage, andRealtimeMediaDemoPage. - Added live
InteractionStatusmonitoring (IN_PROGRESS/IDLE) andAudioTranscriptionConfigMode.SMARTtoggle toLiveAPIDemoPage.
- Integrated
- Documentation & Specifications:
- Added dedicated
doc/widgets_guide.mdspecifying widget states, visual indicators, constructor APIs, and a complete end-to-end screen example. - Updated
doc/api_reference.md,README.md, andREADME_KR.mdwith official widget documentation links.
- Added dedicated
Changed #
- Upgraded package and example dependencies to their latest compatible versions (
camera: ^0.12.1,build_runner: ^2.16.1,flutter_lints: ^6.0.0, etc.). - Synced Live SDK request headers and user-agent to
google-genai-sdk/2.21.0(synced with upstreamjs-genai2.21.0). LiveService.buildSetupMessagenow explicitly validates and rejectsTool.parallelAiSearchin Gemini Developer API mode with clear descriptive error messages.- Bumped package version to
2026.9.9.
Fixed & Tested #
- Expanded widget test suite (
test/widgets_test.dart) to achieve 95%+ line coverage across all newly introduced Flutter widgets. - Verified 0 warnings and 0 errors across
dart doc --dry-runandflutter analyze --fatal-infos --fatal-warnings.
Added #
- Synced DTOs and features with
js-genaiversions 2.14.0, 2.15.0, and 2.16.0 (changes after July 24, 2026):GenerationConfig.audioTranscriptionConfig(audio_transcription_config) andPart.audioTranscription(audio_transcription).GoogleMapsmodel class andTool.googleMapsgrounding options (groundingTypes, e.g.,places,routing).TurnCompleteReason.TOO_MANY_TOOL_CALLSenum value for tool iteration safety terminations.
Changed #
- Synced Live SDK request headers to
google-genai-sdk/2.16.0(synced withjs-genai2.16.0). - Bumped package version to
2026.8.12.
2026.7.24 #
Changed #
- Synced Live SDK request headers to
google-genai-sdk/2.13.0(synced withjs-genai2.13.0). - Bumped package version to
2026.7.24.
2026.7.19 #
Added #
- Synced Live-facing DTOs with
js-genai2.12.0:HistoryConfig— new type withinitialHistoryInClientContentflag; also addedLiveClientSetup.historyConfigandLiveConnectParameters.historyConfig.AudioTranscriptionConfig.customVocabulary— preferred replacement foradaptationPhrases(which is now@Deprecated).
Changed #
- Updated Live SDK request headers to
google-genai-sdk/2.12.0. - Updated all example and documentation model references from the deprecated
gemini-live-2.5-flash-preview(shut down) togemini-3.1-flash-live-preview(latest, March 2026).- Note:
js-genairef still uses the old model string in its test/sample files; this change is based on the official Gemini API models documentation.
- Note:
- Updated README and README_KR supported model descriptions to reflect the current lineup.
- Bumped package version to
2026.7.19.
2026.7.11 #
Added #
- Synced Live-facing DTOs with
js-genai2.11.0:VoiceConsentSignature, plusReplicatedVoiceConfig.consentAudioandReplicatedVoiceConfig.voiceConsentSignature.AudioTranscriptionConfig.languageAuto,AudioTranscriptionConfig.languageHints, andAudioTranscriptionConfig.adaptationPhrases, with the newLanguageAutoandLanguageHintstypes (languageCodesis now deprecated upstream).ComputerUse.disabledSafetyPoliciesand theSafetyPolicyenum.Tool.exaAiSearchand theToolExaAiSearchtype (rejected for the Gemini API during setup).- Server fields:
LiveServerSetupComplete.voiceConsentSignature,Transcription.languageCode,LiveServerContent.interimInputTranscription,VoiceActivity.audioOffset, andUsageMetadata.serviceTierwith the new lowercase-valuedServiceTierenum. LiveSession.setupComplete, populated once the initialsetupCompletemessage arrives.
Changed #
- Renamed
StreamTranslationConfigtoTranslationConfigandGenerationConfig.streamTranslationConfigtoGenerationConfig.translationConfig(wire keytranslation_config). A deprecatedStreamTranslationConfigtypedef andGenerationConfig.streamTranslationConfiggetter remain for backward compatibility. connect()now resolves on thesetupCompletemessage instead of the first frame: messages received before setup completes (includingsetupCompleteitself) are queued and flushed toonMessagein arrival order once the session resolves.- Updated Live SDK request headers to
google-genai-sdk/2.11.0. - Updated package metadata and README installation snippets to
2026.7.11. - Updated the example lockfile to reference the current local package version.
2026.6.6 #
Changed #
- Updated package metadata and README installation snippets to
2026.6.6. - Updated the example lockfile to reference the current local package version.
2026.5.24 #
Added #
- Synced Live-facing DTOs with
js-genai2.6.0:GenerationConfig.streamTranslationConfigThinkingConfig.thinkingLevel- multi-speaker and replicated voice speech config types
FunctionCall.partialArgs/FunctionCall.willContinueFunctionResponseBlob.displayNameandFunctionResponseFileData.displayName- typed
ComputerUseconfig includingenablePromptInjectionDetection
Changed #
- Updated Live SDK request headers to
google-genai-sdk/2.6.0. - Updated package metadata and README installation snippets to
2026.5.24.
2026.4.19 #
Added #
- Added configurable logging for Live API sessions through
LiveService(logger: ...). - Example app now plays Gemini Live audio responses in-app by buffering PCM chunks, wrapping them as WAV, and playing them when a response turn completes.
- Added timestamped chat demo debug logging for connection state, user sends, recorder events, and voice playback transitions.
Changed #
- Live WebSocket traffic logging is now disabled by default.
- Passing
printas the logger restores the previous verbose logging behavior. - Updated publish metadata and README installation snippets to the current date-based version.
- Split example app Live model defaults by demo:
Realtime Medianow targetsgemini-3.1-flash-live-preview.- chat, function-calling, and feature demos stay on the 2.5 compatibility path until the SDK exposes the additional 3.1 history/session controls.
- Restored chat demo
Text Mode/Voice Modeswitching while keeping audio-response sessions compatible with current Live API behavior. - Refined chat voice playback control so autoplay is consumed once per response and old audio bubbles do not restart when the list rebuilds.
- Reduced noisy chat logging by suppressing empty text chunk logs and summarizing audio chunk progress per response.
Fixed #
- Fixed the example app disconnection issue reported in GitHub issue
#8by removing non-audio request flows from Live setup in the app demos. - Fixed example audio playback cleanup so buffered audio is cleared on interruption, connection close, and error paths.
- Fixed example playback triggering to handle turns that finish with
generationCompleteas well asturnComplete. - Fixed chat voice playback so new user input or a newer response stops the currently playing voice response instead of overlapping playback.
- Fixed macOS image picking in the example app by adding the required
user-selected read-onlysandbox entitlement. - Fixed chat screen teardown races so closing or leaving the page no longer triggers
setState()on a defunct widget after the session closes.
2026.4.17 #
Added #
- Synced additional Gemini Live setup fields from the current
js-genaireference:LiveClientSetup.avatarConfigLiveClientSetup.safetySettingsSafetySetting,AvatarConfig,CustomizedAvatar
- Expanded Live enum coverage for newer server responses:
Modality.VIDEOTurnCoverage.TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO- additional
TurnCompleteReasonvalues - additional
TrafficTypevalues - latest safety enums for Gemini blocking config
Changed #
- Updated Live SDK request headers to
google-genai-sdk/1.50.1. - Updated README and README_KR to match the current API surface and date-based package versioning.
2026.3.21 #
Added #
- Added the latest Gemini Live part-schema fields from the current
js-genaireference:Part.mediaResolution,Part.fileData,Part.videoMetadataPart.thoughtSignature,Part.toolCall,Part.toolResponse,Part.partMetadataPartMediaResolution,PartMediaResolutionLevel,ToolCall,ToolResponse,ToolType
- Added
AudioTranscriptionConfig.languageCodesand code execution IDs onExecutableCode/CodeExecutionResult.
Changed #
- Tightened Gemini Live setup validation to reject unsupported
input/outputAudioTranscription.languageCodesbefore sending setup. - Added client-side MIME validation for realtime audio/video payloads so malformed blobs fail fast.
Fixed #
- Fixed
LiveServerMessage.dataso multiple inline binary chunks are concatenated as bytes before base64 encoding. - Fixed session resumption parsing parity by treating
lastConsumedClientMessageIndexas a string.
0.2.2 #
Added #
- Example app now supports in-app Gemini API key configuration via Settings UI.
- Users can save/update/clear API keys directly from the app screen.
- API key is persisted locally with
shared_preferences.
- Added
examples/ephemeral_token.dart:- demonstrates Live API connection using ephemeral tokens (
auth_tokens/...) - uses
GoogleGenAI(apiVersion: 'v1alpha')
- demonstrates Live API connection using ephemeral tokens (
- Added platform-specific runtime info adapters so Dart version reporting works consistently across IO and web builds.
- Added comprehensive automated coverage for Live service flows, transport connectors, and model serialization.
Changed #
- Improved Gemini Live setup handling:
- added
LiveService.buildSetupMessage(...)to centralize setup message construction - added
LiveService.validateFunctionResponses(...)to validate tool responses before sending - default setup now falls back to
responseModalities: [Modality.AUDIO]when omitted - unsupported Gemini API options now fail fast during setup construction
- added
- Expanded Function Calling demo in the example app:
- added richer tool declarations:
get_exchange_rateconvert_currencysearch_placescreate_reminder(non-blocking)
- improved simulated tool responses with structured payloads
- added quick prompt chips for multi-tool scenarios
- added richer tool declarations:
- Updated example/docs descriptions to reflect richer function calling capabilities.
- Documented the public model API more clearly in the package docs.
Fixed #
- Enforced Gemini Live function response IDs so tool replies match
ToolCall.functionCallscontract. - Removed Gemini example usage that relied on unsupported setup parameters.
0.2.1 #
Added #
- Expanded Live tool schema support:
Tool.functionDeclarationsTool.googleSearchTool.googleSearchRetrieval
- Added richer function response fields:
FunctionResponse.schedulingFunctionResponse.willContinueFunctionResponse.parts
- Added Live generation config parity fields:
GenerationConfig.mediaResolutionGenerationConfig.speechConfig(voice config)GenerationConfig.thinkingConfigGenerationConfig.enableAffectiveDialogGenerationConfig.seed
- Added additional Live server metadata parsing:
LiveServerContent.interruptedLiveServerContent.waitingForInputLiveServerContent.turnCompleteReasonLiveServerSetupComplete.sessionId- detailed
UsageMetadatamodality/token breakdown fields
Changed #
- Updated WebSocket connection behavior for Gemini Live ephemeral tokens:
- auto-switches to
BidiGenerateContentConstrained - uses
access_tokenquery parameter when API key starts withauth_tokens/
- auto-switches to
- Added
apiVersionoption toGoogleGenAI(...)so Live API version can be configured from the top-level client. - Updated Live User-Agent version to
google-genai-sdk/1.42.0. - Updated enums and compatibility mapping for current Live API:
ActivityHandling.NO_INTERRUPTION(with backward-compatible alias)- VAD/voice activity typed signals
- traffic/modality token metadata enums
Fixed #
- Fixed tool serialization so configured tools are actually sent in
setup. - Fixed session resumption parsing type for
resumable(bool). - Fixed GoAway parsing to align with
timeLeftand added helper conversion to seconds (timeRemaining). - Improved
LiveServerMessage.textgetter to ignore thought-only parts.
0.2.0 #
New Features (Based on js-genai v1.39.0 Gemini Live API Updates) #
Live Server Message Types
- Added
LiveServerToolCall- Handle tool/function call requests from the model - Added
LiveServerToolCallCancellation- Handle tool call cancellation - Added
LiveServerGoAway- Receive server disconnect warnings - Added
LiveServerSessionResumptionUpdate- Handle session resumption updates - Added
VoiceActivityDetectionSignal- Voice activity detection start/end signals - Added
VoiceActivity- Real-time voice activity status
Live Client Setup Configuration
- Added
RealtimeInputConfig- Configure automatic activity detection, activity handling, and turn coverage - Added
SessionResumptionConfig- Enable session resumption with handle and transparent mode - Added
ContextWindowCompressionConfig- Configure context window compression with trigger tokens and sliding window - Added
AudioTranscriptionConfig- Enable input/output audio transcription - Added
ProactivityConfig- Configure proactive audio features - Added
explicitVadSignaloption - Enable explicit VAD signaling
Live Client Realtime Input Enhancements
- Added
mediaChunkssupport - Send multiple media chunks at once - Added
audioStreamEnd- Signal end of audio stream - Added
text- Send real-time text input - Added
ActivityStart/ActivityEnd- Manual activity detection signals
Function Calling Support
- Added
LiveClientToolResponse- Send tool/function responses to the model - Added
FunctionCall- Model function call representation with id, name, and args - Added
FunctionResponse- Function response with id, name, and response data
New Session Methods
- Added
sendClientContent()- Send multi-turn client content - Added
sendRealtimeInput()- Send combined real-time input (audio, video, text, activity signals) - Added
sendMediaChunks()- Send media chunks array - Added
sendAudioStreamEnd()- Signal audio stream end - Added
sendRealtimeText()- Send real-time text - Added
sendActivityStart()/sendActivityEnd()- Manual activity detection - Added
sendToolResponse()- Send tool responses - Added
sendFunctionResponse()- Send single function response - Added
close()- Close WebSocket connection - Added
isClosedgetter - Check connection status
New Enums
- Added
ActivityHandling- Activity handling strategies (START_OF_ACTIVITY_INTERRUPTS, etc.) - Added
TurnCoverage- Turn coverage options (TURN_INCLUDES_ALL_INPUT, etc.) - Added
StartSensitivity- Speech start sensitivity levels - Added
EndSensitivity- Speech end sensitivity levels
Example App Updates
- Added
live_api_demo.dart- Comprehensive demo of all new features - Added
function_calling_demo.dart- Function calling demo with weather/time functions - Added
realtime_media_demo.dart- Real-time media input with manual/auto VAD - Updated
main.dart- New home page with navigation to all demos
Improvements #
- Added
datagetter toLiveServerMessagefor accessing base64 encoded inline data - Updated User-Agent to
google-genai-sdk/1.39.0 - Added
TimeoutExceptionfor connection timeout handling - Improved documentation and examples
0.1.1 #
- Update dependencies and generated model serialization
- Update web_socket_service_web.dart
- Update web_socket_service_stub.dart
0.1.0 #
- Update Readme
- Documentation
0.0.5 #
- Update Readme
0.0.4 #
- Update Readme
0.0.3 #
- Add Example
- Improve Web Support
- Remove Platform.version (dartVersion)
0.0.2 #
- Update README.md
0.0.1 #
- Initial version of the package.
- Added Gemini Live Code