Build a Gemini 3 Flash-Powered AI App in Python
In this YouTube Short, we use the model to build a vision AI app in under five minutes that watches your camera feed in real time and answers questions about objects and surroundings.
Let's look at how to create a similar experience with Gemini Python plugin in Vision Ageents, an open-source platform for voice/video AI apps.
Overview of the Agent
In a short time, you will create a digital system that has vision capabilities. It can be used for object detection, scene understanding, and activity recognition. The entire voice system uses:
- Gemini 3 Flash for handling the agent's operations.
- Inworld AI for audio generation.
- Deepgram for automatic speech recognition.
- Smart-Turn to recognize when speaking starts and ends.
Step 1: Begin With Vision Agents Python Project
uv init gemini-vision-agent
cd gemini-vision-agent
uv add vision-agents
uv add "vision-agents[getstream, gemini, inworld, deepgram, smart-turn]"Step 2: Store These in the Python Project
Create a .env file in your project's root and add these API credentials.
touch .env
GOOGLE_API_KEY=...
INWORLD_API_KEY=...
DEEPGRAM_API_KEY=...
STREAM_API_KEY=...
STREAM_API_SECRET=...
EXAMPLE_BASE_URL=https://pronto-staging.getstream.ioStep 3: Fill Out main.py
Substitute the generated Python project's main.py with this sample code.
import asyncio
import os
from vision_agents import Agent, register
from vision_agents.llm import GeminiLLM
from vision_agents.tts import InworldTTS
from vision_agents.stt import DeepgramSTT
from vision_agents.turn_detection import SmartTurn
from vision_agents.stream import StreamVideoCall
async def main():
# 1. Gemini 3 Flash as the multimodal brain
llm = GeminiLLM(
model="gemini-3-flash-preview",
api_key=os.getenv("GOOGLE_API_KEY")
)
# 2. Voice pipeline
tts = InworldTTS(api_key=os.getenv("INWORLD_API_KEY"))
stt = DeepgramSTT(api_key=os.getenv("DEEPGRAM_API_KEY"))
turn_detector = SmartTurn()
# 3. Create the vision agent
agent = Agent(
llm=llm,
tts=tts,
stt=stt,
turn_detector=turn_detector,
name="Vision Assistant",
system_prompt="""
You are an expert vision AI assistant. Analyze the live camera feed in real time.
Describe objects clearly, notice when they change, and answer questions accurately.
Be concise, helpful, and speak naturally.
"""
)
register(agent)
# 4. Launch real-time video call
call = StreamVideoCall(
api_key=os.getenv("STREAM_API_KEY"),
api_secret=os.getenv("STREAM_API_SECRET"),
call_type="default",
call_id="gemini-vision-demo"
)
await call.join()
print("Vision AI app ready! Open this URL in your browser:")
print(call.url)
# 5. Run the agent
await agent.run(call)
if __name__ == "__main__":
asyncio.run(main())This script builds a voice/vision assistant you can speak with in realtime for camera feed analysis and environmental objects detection. Enjoy .
