Skip to content

Commit 7ee9cf4

Browse files
committed
feat: Update model to gemini-3.1-flash-live-preview and configure turn coverage for activity-only turns.
1 parent bd4603f commit 7ee9cf4

7 files changed

Lines changed: 8 additions & 21 deletions

File tree

command-line/python/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
pya = pyaudio.PyAudio()
1515

1616
# --- Live API config ---
17-
MODEL = "gemini-2.5-flash-native-audio-preview-12-2025"
17+
MODEL = "gemini-3.1-flash-live-preview"
1818
CONFIG = {
1919
"response_modalities": ["AUDIO"],
2020
"system_instruction": "You are a helpful and friendly AI assistant.",

gemini-live-ephemeral-tokens-websocket/frontend/geminilive.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ class GeminiLiveAPI {
346346
},
347347
systemInstruction: { parts: [{ text: this.systemInstructions }] },
348348
tools: [{ functionDeclarations: tools }],
349+
turnCoverage: "TURN_INCLUDES_ONLY_ACTIVITY",
349350
// proactivity: this.proactivity,
350351

351352
// realtimeInputConfig: {

gemini-live-ephemeral-tokens-websocket/frontend/script.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ function initDOM() {
2222
"enableInputTranscription",
2323
"enableOutputTranscription",
2424
"enableGrounding",
25-
"enableAffectiveDialog",
2625
"enableAlertTool",
2726
"enableCssStyleTool",
28-
"enableProactiveAudio",
2927
"voiceSelect",
3028
"temperature",
3129
"temperatureValue",
@@ -136,16 +134,10 @@ async function connect() {
136134
state.client.outputAudioTranscription =
137135
elements.enableOutputTranscription.checked;
138136
state.client.googleGrounding = elements.enableGrounding.checked;
139-
state.client.enableAffectiveDialog = elements.enableAffectiveDialog.checked;
140137
state.client.responseModalities = ["AUDIO"];
141138
state.client.voiceName = elements.voiceSelect.value;
142139
state.client.temperature = parseFloat(elements.temperature.value);
143140

144-
// Set proactivity configuration
145-
state.client.proactivity = {
146-
proactiveAudio: elements.enableProactiveAudio.checked,
147-
};
148-
149141
// Set automatic activity detection configuration
150142
state.client.automaticActivityDetection = {
151143
disabled: elements.disableActivityDetection.checked,

gemini-live-genai-python-sdk/frontend/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ <h3>Features Enabled:</h3>
3535
<li>
3636
<strong>Multilingual:</strong> Speak in different languages
3737
</li>
38-
<li>
39-
<strong>Proactive Audio:</strong> Gemini can initiate speech
40-
based on instructions E.g. "Only talk when I mention food"
41-
</li>
42-
<li><strong>Affective Audio:</strong> Emotional tone matching</li>
38+
4339
</ul>
4440
<p>
4541
<em

gemini-live-genai-python-sdk/frontend/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ const geminiClient = new GeminiClient({
3030
// Send hidden instruction
3131
geminiClient.sendText(
3232
`System: Introduce yourself as a demo of the Gemini Live API.
33-
Suggest playing with features like the native audio for accents, multilingual support,
34-
proactive audio by asking you not to speak until I say something specific,
35-
or the affective audio capabilities by changing the emotion in your voice to
36-
match the tone of the conversation. Keep the intro concise and friendly.`
33+
Suggest playing with features like the native audio for accents and multilingual support.
34+
Keep the intro concise and friendly.`
3735
);
3836
},
3937
onMessage: (event) => {

gemini-live-genai-python-sdk/gemini_live.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ async def start_session(self, audio_input_queue, video_input_queue, text_input_q
4242
system_instruction=types.Content(parts=[types.Part(text="You are a helpful AI assistant. Keep your responses concise. Speak in a friendly Irish accent. You can see the user's camera or screen which is shared as realtime input images with you.")]),
4343
input_audio_transcription=types.AudioTranscriptionConfig(),
4444
output_audio_transcription=types.AudioTranscriptionConfig(),
45-
#proactivity=types.ProactivityConfig(proactive_audio=True),
46-
#enable_affective_dialog=True,
45+
turn_coverage="TURN_INCLUDES_ONLY_ACTIVITY",
46+
4747
tools=self.tools,
4848
)
4949

gemini-live-genai-python-sdk/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# Configuration
2424
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
25-
MODEL = os.getenv("MODEL", "gemini-2.5-flash-native-audio-preview-12-2025")
25+
MODEL = os.getenv("MODEL", "gemini-3.1-flash-live-preview")
2626

2727
# Initialize FastAPI
2828
app = FastAPI()

0 commit comments

Comments
 (0)