Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Run through the Get Started section of the notebook.
/ 10
Set the Gemini model ID.
/ 15
Run the cell configure_session in the notebook.
/ 15
Run the cell send_and_receive_turn in the notebook.
/ 15
Run the cell run_live_session in the notebook.
/ 15
Run the Conversation Setup and Execution cell of the notebook.
/ 15
Run the Configuration and Execution cell of the notebook.
/ 15
Run through the Get Started section of the notebook.
/ 10
Set the Gemini model ID.
/ 15
Run the cell configure_session in the notebook.
/ 15
Run the cell send_and_receive_turn in the notebook.
/ 15
Run the cell run_live_session in the notebook.
/ 15
Run the Conversation Setup and Execution cell of the notebook.
/ 15
Run the Configuration and Execution cell of the notebook.
/ 15
The Gemini Live API offers native audio dialog capabilities, enabling developers to build sophisticated, human-like, and responsive real-time conversational AI agents. By directly managing speech-to-speech interactions, this feature eliminates the need for separate speech-to-text and text-to-speech components.
Voice interfaces within the Generative AI domain are evolving from simple commands to fluid, engaging conversational experiences. The Gemini Live API facilitates this shift by allowing developers to create real-time, bidirectional audio streaming applications.
These applications support advanced functionalities, including seamless interruption handling, proactive "chime-in" behaviors, and affective (empathetic) responses.
This lab focuses on connecting to the Gemini Live API on Agent Platform using the Google Gen AI SDK for Python. You configure a session for native audio streams and explore two distinct use cases: a proactive assistant that selectively joins conversations when relevant and an empathetic technical advisor designed to respond to user frustration.
In this lab, you perform the following tasks:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In the Google Cloud console, on the Navigation menu (), click Agent Platform > Notebooks > Workbench.
Find the
The JupyterLab interface for your Workbench instance opens in a new browser tab.
Open the
In the Select Kernel dialog, choose Python 3 (Local) from the list of available kernels.
Run through the Getting Started section of the notebook. The Project ID and Location are pre-configured for you.
Click Check my progress to verify the objective.
In this lab, you use
Click Check my progress to verify the objective.
The following functions manage the session configuration, handle a single conversational turn, and execute a multi-turn session.
configure_sessionThis function creates a flexible LiveConnectConfig object to enable or disable features like system instruction, transcription, proactivity, and affective dialog.
configure_session section in the notebook to create a configuration object for the Live Connect session.Click Check my progress to verify the objective.
send_and_receive_turnThis asynchronous function manages a single user turn: it sends the text, streams the audio and transcription messages back from the model, and displays the results.
send_and_receive_turn section in the notebook to send a single text turn to the Live Connect session and process and display the streaming response.Click Check my progress to verify the objective.
run_live_sessionThis function manages the full conversational context, establishing the connection and running a series of defined turns.
run_live_session section in the notebook to establish the Live Connect session and run a series of conversational turns.Click Check my progress to verify the objective.
In Task 5, you test the model's capabilities through two practical use cases to observe its interaction triggers:
Scenario 1: Proactive Audio (chime-in behavior). You use a system instruction and enable_proactivity that directs the model to remain silent during an off-topic conversation and only interject when the topic becomes on-topic.
Scenario 2: Affective Dialog (empathy). You enable enable_affective_dialog to explore the model's ability to respond with an empathetic tone.
This example uses a System Instruction and Proactive Audio to explore the model's ability to remain silent when the topic is off-subject (French cuisine) and chime in only when the conversation shifts to the instructed topic (Italian cooking).
Click Check my progress to verify the objective.
This scenario enables Affective Dialog (enable_affective_dialog=True) and uses a system instruction to create a senior technical advisor persona. The user's input is phrased to convey frustration, prompting an empathetic and helpful response from the model.
Click Check my progress to verify the objective.
You have successfully connected to the Gemini Live API on Agent Platform. You configured a session to handle native audio and implemented advanced features like proactive chime-in and affective dialog.
Check out the following resources to learn more about Gen AI and the Gemini Enterprise Agent Platform:
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated May 18, 2026
Lab Last Tested February 26, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one