From 3dd7e3f1b9be05c28adb061864d84c4202a2d922 Mon Sep 17 00:00:00 2001 From: "Xiang (Sean) Zhou" Date: Sun, 18 Jan 2026 21:03:30 -0800 Subject: [PATCH] chore: Update sample live streaming tools agent to use latest live models Co-authored-by: Xiang (Sean) Zhou PiperOrigin-RevId: 858001541 --- .../live_bidi_streaming_tools_agent/agent.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contributing/samples/live_bidi_streaming_tools_agent/agent.py b/contributing/samples/live_bidi_streaming_tools_agent/agent.py index c556518656..18a947bbc4 100644 --- a/contributing/samples/live_bidi_streaming_tools_agent/agent.py +++ b/contributing/samples/live_bidi_streaming_tools_agent/agent.py @@ -18,7 +18,6 @@ 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