The Open Standard for Generative UI
Google ADK
An OpenUI example showing how to wire a Google Agent Development Kit (ADK) agent (TypeScript) to OpenUI Cloud.
What this demonstrates
- A Google ADK
Agentwith aFunctionTool(weather) running inside a Next.js API route via anInMemorySessionService+Runner - The model is OpenUI Cloud via Chat Completions (
POST /v1/embed/chat/completions). ADK JS has no first-party OpenAI client, soadk-llm-bridge'sCustom()adapter supplies aBaseLlm - Bridging ADK's
runAsyncevent stream into AG-UI SSE (TEXT_MESSAGE_*,TOOL_CALL_START/ARGS/END/RESULT) so OpenUI'sagUIAdapter()can parse them - Rendering streamed OpenUI Lang with
<AgentInterface />andopenuiLibrary
Getting started
Mint an OpenUI Cloud key into
.env.local:pnpm generate:apiKeyInstall dependencies from this example directory:
pnpm install --ignore-workspaceRun the dev server from this directory:
pnpm dev
Open http://localhost:3000 and try a starter such as "What's the weather like in Tokyo right now?".
How it works
src/agent.tsdefines theget_weathertool and acreateAgent()builder. The instruction iscloudInstructions(), which reads the generatedopenuiLibraryspec. The model is Cloud's Gemini (google/gemini-3.6-flash-free).src/app/api/chat/route.tsruns the agent with aRunnerand keys ADK sessions by chatthreadId(so multi-turn history is preserved).src/lib/adk-to-agui.tsmaps ADKfunctionCall/functionResponseparts onto AG-UI tool events (includingTOOL_CALL_RESULT) and streams assistant text asTEXT_MESSAGE_*events.src/app/page.tsxrenders<AgentInterface />withfetchLLM+agUIAdapter().
To add more tools, define them with FunctionTool in src/agent.ts and pass
them to the Agent.
Learn more
Verify
pnpm verify