Skip to content

Commit 3dd7e3f

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: Update sample live streaming tools agent to use latest live models
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 858001541
1 parent 81eaeb5 commit 3dd7e3f

File tree

1 file changed

+8
-5
lines changed
  • contributing/samples/live_bidi_streaming_tools_agent

1 file changed

+8
-5
lines changed

contributing/samples/live_bidi_streaming_tools_agent/agent.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from google.adk.agents import LiveRequestQueue
1919
from google.adk.agents.llm_agent import Agent
2020
from google.adk.tools.function_tool import FunctionTool
21-
from google.genai import Client
2221
from google.genai import types as genai_types
2322

2423

@@ -54,6 +53,8 @@ async def monitor_video_stream(
5453
) -> AsyncGenerator[str, None]:
5554
"""Monitor how many people are in the video streams."""
5655
print("start monitor_video_stream!")
56+
from google.genai import Client
57+
5758
client = Client(vertexai=False)
5859
prompt_text = (
5960
"Count the number of people in this image. Just respond with a numeric"
@@ -87,7 +88,7 @@ async def monitor_video_stream(
8788

8889
# Call the model to generate content based on the provided image and prompt
8990
response = client.models.generate_content(
90-
model="gemini-2.0-flash-exp",
91+
model="gemini-2.5-flash",
9192
contents=contents,
9293
config=genai_types.GenerateContentConfig(
9394
system_instruction=(
@@ -121,9 +122,11 @@ def stop_streaming(function_name: str):
121122

122123

123124
root_agent = Agent(
124-
# find supported models here: https://google.github.io/adk-docs/get-started/streaming/quickstart-streaming/
125-
model="gemini-2.0-flash-live-preview-04-09", # for Vertex project
126-
# model="gemini-live-2.5-flash-preview", # for AI studio key
125+
# see https://docs.cloud.google.com/vertex-ai/generative-ai/docs/migrate
126+
# for vertex model names
127+
model="gemini-live-2.5-flash-native-audio", # vertex
128+
# see https://ai.google.dev/gemini-api/docs/models for AIS model names
129+
# model='gemini-2.5-flash-native-audio-latest', # for AI studio
127130
name="video_streaming_agent",
128131
instruction="""
129132
You are a monitoring agent. You can do video monitoring and stock price monitoring

0 commit comments

Comments
 (0)