chore: Update sample live streaming tools agent to use latest live models

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 858001541
This commit is contained in:
Xiang (Sean) Zhou
2026-01-18 21:04:06 -08:00
committed by Copybara-Service
parent 81eaeb5eba
commit 3dd7e3f1b9
@@ -18,7 +18,6 @@ from typing import AsyncGenerator
from google.adk.agents import LiveRequestQueue
from google.adk.agents.llm_agent import Agent
from google.adk.tools.function_tool import FunctionTool
from google.genai import Client
from google.genai import types as genai_types
@@ -54,6 +53,8 @@ async def monitor_video_stream(
) -> AsyncGenerator[str, None]:
"""Monitor how many people are in the video streams."""
print("start monitor_video_stream!")
from google.genai import Client
client = Client(vertexai=False)
prompt_text = (
"Count the number of people in this image. Just respond with a numeric"
@@ -87,7 +88,7 @@ async def monitor_video_stream(
# Call the model to generate content based on the provided image and prompt
response = client.models.generate_content(
model="gemini-2.0-flash-exp",
model="gemini-2.5-flash",
contents=contents,
config=genai_types.GenerateContentConfig(
system_instruction=(
@@ -121,9 +122,11 @@ def stop_streaming(function_name: str):
root_agent = Agent(
# find supported models here: https://google.github.io/adk-docs/get-started/streaming/quickstart-streaming/
model="gemini-2.0-flash-live-preview-04-09", # for Vertex project
# model="gemini-live-2.5-flash-preview", # for AI studio key
# see https://docs.cloud.google.com/vertex-ai/generative-ai/docs/migrate
# for vertex model names
model="gemini-live-2.5-flash-native-audio", # vertex
# see https://ai.google.dev/gemini-api/docs/models for AIS model names
# model='gemini-2.5-flash-native-audio-latest', # for AI studio
name="video_streaming_agent",
instruction="""
You are a monitoring agent. You can do video monitoring and stock price monitoring