Build Multimodal Live Agents Easily with Google's ADK and Gemini API
Google for DevelopersMay 16, 202520 min20,125 views
37 connectionsΒ·40 entities in this videoβBuilding Live Agents with Gemini API
- π‘ The initial approach involves building a multimodal live agent using the Gemini API, requiring a client, proxy, and the Gemini Live API itself.
- π οΈ The proxy handles tool usage and authentication, routing user requests to the Gemini Live API, which acts as the application's brain.
- π§© A key challenge is managing the tool handler, which matches function calls from the Live API with background tools like a cloud run function for weather.
- β‘ The Gemini Live API recognizes when a tool is needed, generates a function call with parameters, and the tool handler executes it, returning data to the API for a human-like response.
Simplifying with Agent Development Kit (ADK)
- β¨ The Agent Development Kit (ADK) drastically simplifies live agent creation by removing the need for a custom proxy and handling core components.
- π ADK provides a wrapper around the Gemini Live Streaming API, managing websockets and message formatting automatically.
- π₯ Developers only need to implement two main functions:
handle_client_messagesto queue data (audio, text, video) andhandle_agent_responsesto process events and return them to the frontend. - π§© ADK handles function calls, tool execution, and returns various events including audio, transcripts, and images, significantly reducing boilerplate code.
Instantiating and Running Live Agents with ADK
- βοΈ To instantiate a live agent with ADK, you configure
voice_configandrun_config, specifying modalities like audio with transcripts enabled. - βΆοΈ A normal agent is transformed into a live agent by calling
runner.run_live()instead ofrunner.run(). - π§ The core agent construction (model type, name, description, instructions, tools) remains the same as for non-live agents.
- π Demos show that ADK provides identical performance to the manual Gemini API approach but with significantly simplified development.
Benefits and Next Steps
- β ADK allows developers to focus on building agentic systems rather than infrastructure like UI and proxy servers.
- π The key for developers is understanding how to build normal agents, as ADK handles the live streaming complexities.
- π Developers are encouraged to explore the ADK streaming documentation to start building their own live agents.
Knowledge graph40 entities Β· 37 connections
How they connect
An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.
Hover Β· drag to explore
40 entities
Chapters8 moments
Key Moments
Transcript77 segments
Full Transcript
Topics13 themes
Whatβs Discussed
Multimodal AgentsLive Streaming APIGemini APIAgent Development Kit (ADK)Function CallingTool UsageReal-time InteractionWebsocketsCloud RunGenerative AIAI AgentsGoogle CloudVertex AI
Smart Objects40 Β· 37 links
ProductsΒ· 22
CompaniesΒ· 3
ConceptsΒ· 13
PersonΒ· 1
LocationΒ· 1