Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- The Flutter toolchain and Python 3.11+ installed on your device.
- A Google API key with Gemini Live API access.
You need a Zero Runtime account to generate a token and a Google API key for the Gemini Live API.
Generate a token from the Zero Runtime Dashboard and a Google API key from Google AI Studio.
Project Structure
Your project structure should look like this:root
android
ios
lib
api_call.dart
join_screen.dart
main.dart
meeting_controls.dart
meeting_screen.dart
participant_tile.dart
macos
web
windows
agent-flutter.py
.env
join_screen.dart: Responsible for the user interface to join a meeting.meeting_screen.dart: Displays the meeting interface and handles meeting logic.api_call.dart: Handles API calls for creating meetings.agent-flutter.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for the Python agent’s API keys.
1. Flutter Frontend
Step 1: Create the Flutter app
Create a new Flutter app using the following command:Install the RTC SDK using the following Flutter command. Make sure you are in your Flutter app directory before you run this command.
Step 2: Configure native platform permissions
- Android
- iOS
- macOS
Update If necessary, in
/android/app/src/main/AndroidManifest.xml for the permissions used to implement the audio and video features.android/app/src/main/AndroidManifest.xml
build.gradle you will need to increase the minSdkVersion of defaultConfig up to 23 (Flutter’s generator defaults it to 16).Step 3: Configure environment and credentials
Create a meeting room using the Zero Runtime API:Copy the
roomId from the response and configure it in lib/join_screen.dart and lib/api_call.dart.lib/api_call.dart
lib/join_screen.dart
Step 4: Design the user interface
Create the main
MeetingScreen widget with audio-only interaction in lib/meeting_screen.dart:lib/meeting_screen.dart
lib/participant_tile.dart
lib/meeting_controls.dart
2. Python AI Agent
Step 1: Setup the project
Use Python 3.11 or higher, then install the Zero Runtime Agents SDK. Create and activate a virtual environment, then install
zrt and python-dotenv. Every provider plugin ships with zrt.Step 2: Configure environment variables
Create a
.env file in your project root to store your keys and token securely for the Python agent:.env
Step 3: Create the AI agent backend
Create the Python AI agent (
agent-flutter.py) that joins the same meeting room and interacts with users through voice.agent-flutter.py
3. Run the Application
Step 1: Run the Flutter app
Once you have completed all the steps above, start your Flutter application:
Step 2: Run the AI agent
Open a new terminal, activate your virtual environment, and run the Python agent. It reads
GOOGLE_API_KEY from the .env file.Step 3: Connect and interact
-
Join the meeting from the Flutter app:
- Tap the Join Meeting button.
- Allow microphone permissions when prompted.
-
Agent connection:
- Once you join, the Python agent detects your participation.
- You should see “Participant joined” in the terminal.
- The AI agent greets you and initiates the game.
-
Start playing:
- The agent guides you through a number guessing game (1–100).
- Use your microphone to interact with the AI host.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure both the Flutter app and the agent are running.
- Check that the room ID matches in both
lib/join_screen.dartandagent-flutter.py. - Verify your Zero Runtime token is valid.
Audio not working
Audio not working
- Check device permissions for microphone access.
- Ensure your Google API key has Gemini Live API access enabled.
Agent not responding
Agent not responding
- Verify your
GOOGLE_API_KEYis set in the.envfile. - Check that the Gemini Live API is enabled in your Google Cloud Console.
Flutter build issues
Flutter build issues
- Ensure your Flutter version is compatible.
- Try cleaning the build:
flutter clean. - Delete
pubspec.lockand runflutter pub get.
Next Steps
Quickstart Example
Complete working example with source code.
Build Your First Voice Agent
Learn the Cascade and Realtime pipelines in depth.