Skip to content

Commit ee76727

Browse files
heavygeeHAPI
andcommitted
fix(voice): send greeting trigger in reactive mode for Gemini
Gemini Live has no built-in first-message like ElevenLabs agents do; without an explicit turnComplete:true it sits silently. In reactive mode (default, toggle off) now sends a greeting instruction after any silent context feed so Gemini introduces itself and invites the user to speak. Proactive mode is unchanged: the context summary is the opening speech. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run>
1 parent a8918fe commit ee76727

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

web/src/realtime/GeminiLiveVoiceSession.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,18 @@ class GeminiLiveVoiceSessionImpl implements VoiceSession {
181181
// Start audio capture
182182
startAudioCapture(state.playbackContext!)
183183

184-
// Send initial context if available (no clientContent greeting — it breaks tool calls)
185-
// In reactive mode (default) send silently so Gemini doesn't narrate on connect.
184+
const proactive = localStorage.getItem('hapi-voice-proactive') === 'true'
185+
186186
if (config.initialContext) {
187-
const proactive = localStorage.getItem('hapi-voice-proactive') === 'true'
187+
// Proactive: speak the summary. Reactive: feed context silently.
188188
sendClientContent(`[Context] ${config.initialContext}`, proactive)
189189
}
190190

191+
if (!proactive) {
192+
// Gemini won't self-start; send a greeting trigger so it introduces itself.
193+
sendClientContent('[Introduce yourself briefly and invite the user to speak.]', true)
194+
}
195+
191196
resolve()
192197
return
193198
}

0 commit comments

Comments
 (0)