Google AI 的前端可操作性 A2UI 代码操作

Google AI 的前端可操作性 A2UI 代码操作

Get started: Try out A2UI

The best way to understand A2UI is to see it in action.

  • Start by going to a2ui.org and reading the quickstart guide and documentation.
  • Next go to the samples folder and try a client UI and some background sample agents, perhaps the restaurant finder.

Here’s how to launch the restaurant finder:

快速开始:试用A2UI
了解A2UI的最佳方式就是亲身体验。

首先访问a2ui.org,阅读快速入门指南和文档。
接着进入示例文件夹,尝试客户端界面和一些后台示例代理程序,比如餐厅查找器。
以下是启动餐厅查找器的方法:

git clone https://github.com/google/A2UI.git
export GEMINI_API_KEY="your_gemini_api_key"

# Run the restaurant finder A2A agent
cd A2UI/samples/agent/adk/restaurant_finder
uv run .

# Run the lit client that uses the A2UI lit renderer library
cd A2UI/samples/client/lit/shell
npm install
npm run dev

Another way to see A2UI in action is to try the GenUI SDK for Flutter.

The GenUI SDK for Flutter uses A2UI under the covers when talking to remote or server-side agents. It's easy to get started, visit https://docs.flutter.dev/ai/genui or watch the Getting started with GenUI video. In the GenUI SDK repo on GitHub, you can also find a client-server sample that uses A2UI.

CopilotKit has a public A2UI Widget Builder to try out as well.

另一种体验A2UI实际效果的方式是尝试Flutter版GenUI SDK。

Flutter版GenUI SDK在与远程或服务端智能体通信时,底层使用的正是A2UI技术。入门非常简单,请访问https://docs.flutter.dev/ai/genui 或观看《GenUI入门视频》。在GitHub的GenUI SDK代码库中,您还能找到使用A2UI的客户端-服务端示例项目。

CopilotKit平台也提供了公开的A2UI组件构建器供您试用。

Supported integrations

Here are a few key integrations that the project has today, and some that we hope the project supports in the future. We welcome community contributions in these areas.

支持的集成 以下是该项目目前已实现的若干关键集成,以及我们希望未来能支持的集成方向。我们诚挚欢迎社区在这些领域贡献力量。

Quick Overview

Building an A2UI agent:

  1. Understand user intent → Decide what UI to show
  2. Generate A2UI JSON → Use LLM structured output or prompts
  3. Validate & stream → Check schema, send to client
  4. Handle actions → Respond to user interactions

Start with a simple agent

We will use the ADK to build a simple agent. We will start with text and eventually upgrade it to A2UI.

See step-by-step instructions at the ADK quickstart.

pip install google-adk
adk create my_agent

Then edit the my_agent/agent.py file with a very simple agent for restaurant recommendations.

import json from google.adk.agents.llm_agent import Agent from google.adk.tools.tool_context import ToolContext def get_restaurants(tool_context: ToolContext) -> str: """Call this tool to get a list of restaurants.""" return json.dumps([ { "name": "Xi'an Famous Foods", "detail": "Spicy and savory hand-pulled noodles.", "imageUrl": "http://localhost:10002/static/shrimpchowmein.jpeg", "rating": "★★★★☆", "infoLink": "[More Info](https://www.xianfoods.com/)", "address": "81 St Marks Pl, New York, NY 10003" }, { "name": "Han Dynasty", "detail": "Authentic Szechuan cuisine.", "imageUrl": "http://localhost:10002/static/mapotofu.jpeg", "rating": "★★★★☆", "infoLink": "[More Info](https://www.handynasty.net/)", "address": "90 3rd Ave, New York, NY 10003" }, { "name": "RedFarm", "detail": "Modern Chinese with a farm-to-table approach.", "imageUrl": "http://localhost:10002/static/beefbroccoli.jpeg", "rating": "★★★★☆", "infoLink": "[More Info](https://www.redfarmnyc.com/)", "address": "529 Hudson St, New York, NY 10014" }, ])" You are a helpful restaurant finding assistant. Your goal is to help users find and book restaurants using a rich UI. To achieve this, you MUST follow this logic: 1. **For finding restaurants:** a. You MUST call the `get_restaurants` tool. Extract the cuisine, location, and a specific number (`count`) of restaurants from the user's query (e.g., for "top 5 chinese places", count is 5). b. After receiving the data, you MUST follow the instructions precisely to generate the final a2ui UI JSON, using the appropriate UI example from the `prompt_builder.py` based on the number of restaurants.""" root_agent = Agent( model='gemini-2.5-flash', name="restaurant_agent", description="An agent that finds restaurants and helps book tables.", instruction=AGENT_INSTRUCTION, tools=[get_restaurants], )

开发文档阅读 https://a2ui.org/guides/agent-development/

集合仓库 https://a2ui-composer.ag-ui.com/gallery

https://a2ui.org/

https://github.com/google/A2UI

Read more

OpenClaw&Discord 多 Agent 多频道配置实战:从零搭建你的 AI 团队(附踩坑实录)

OpenClaw&Discord 多 Agent 多频道配置实战:从零搭建你的 AI 团队(附踩坑实录)

本文记录了我从零开始配置 OpenClaw 多 Agent 多 Discord 频道的完整过程,基于最新的 OpenClaw 2026.2.22-2 版本,包含实际配置文件和踩坑实录。 一、背景与需求 1.1 为什么要多 Agent? 当 AI Agent 的应用场景越来越丰富时,单一 Agent 很难同时胜任多种专业任务: * 编程任务需要代码能力和技术深度 * 内容创作需要写作技巧和文案感觉 * 健康管理需要健身知识和营养学背景 * 投资分析需要金融市场理解和数据敏感性 让每个 Agent 专注一个领域,比让一个 Agent 什么都懂但什么都不精要好得多。 1.2 为什么要多 Discord 频道? 在 Discord 场景中,不同的频道有不同的氛围和用途: 频道用途对应 Agent#🎯-指挥台主沟通入口,任务分发Cypher

AI 原生架构:鸿蒙App的下一代形态

AI 原生架构:鸿蒙App的下一代形态

子玥酱(掘金 / 知乎 / ZEEKLOG / 简书 同名) 大家好,我是子玥酱,一名长期深耕在一线的前端程序媛 👩‍💻。曾就职于多家知名互联网大厂,目前在某国企负责前端软件研发相关工作,主要聚焦于业务型系统的工程化建设与长期维护。 我持续输出和沉淀前端领域的实战经验,日常关注并分享的技术方向包括前端工程化、小程序、React / RN、Flutter、跨端方案, 在复杂业务落地、组件抽象、性能优化以及多端协作方面积累了大量真实项目经验。 技术方向:前端 / 跨端 / 小程序 / 移动端工程化 内容平台:掘金、知乎、ZEEKLOG、简书 创作特点:实战导向、源码拆解、少空谈多落地 文章状态:长期稳定更新,大量原创输出 我的内容主要围绕 前端技术实战、真实业务踩坑总结、框架与方案选型思考、行业趋势解读 展开。文章不会停留在“API 怎么用”,而是更关注为什么这么设计、在什么场景下容易踩坑、

电脑端 搜狗输入法自动弹皮肤推荐、AI旺仔关闭方法

电脑端 搜狗输入法自动弹皮肤推荐、AI旺仔关闭方法

1. 背景 1. 电脑端 搜狗输入法 莫名其妙多了一个狗头,叫“AI旺仔”。即下方输入法快捷栏最后一个狗头就是。点击狗头会出现以下界面。 2. 有时 输入法快捷栏 上方也会出现皮肤等,很占屏幕空间 3. 还有选中自动取词,本来是想选中复制的,结果每次选中都会有弹框 2. 自动弹皮肤推荐/宠物弹泡 关闭方法 点击搜狗输入法状态栏S图标→常用设置→更多设置→点击属性设置中高级→滚动页面到底部,关闭皮肤推荐、皮肤弹泡推荐右边的按钮,全部给关闭。 3. 关闭 AI旺仔 方法 1. 关闭自启动:点状态栏AI汪仔图标→右下角【齿轮设置】→更多设置→关闭【自启动AI汪仔】 2. 关闭快捷键弹出:点状态栏AI汪仔图标→右下角【齿轮设置】→可以关闭快捷键按【=】或【

AI如何帮你快速生成机械零件3D模型?

快速体验 1. 打开 InsCode(快马)平台 https://www.inscode.net 2. 点击'项目生成'按钮,等待项目生成完整后预览效果 输入框内输入如下内容: 创建一个能够根据用户输入的自然语言描述自动生成机械零件3D模型的Web应用。用户可以通过简单的文字描述(如'生成一个M6螺栓,长度30mm,六角头'),系统自动转换为3D模型代码(如STL或STEP格式),并提供实时预览和下载功能。应用需包含常见机械零件库(螺栓、齿轮、轴承等)的预设模板,支持参数化调整。使用Three.js或类似库实现3D渲染,后端处理用户输入并生成对应模型代码。 最近在做一个机械设计项目,需要频繁创建各种零件的3D模型。传统建模软件虽然强大,但学习成本高、操作繁琐。于是我开始探索AI辅助开发的可能性,发现用自然语言描述就能自动生成3D模型代码的方案特别实用。以下是具体实现思路和经验分享。 1. 核心功能设计 这个Web应用的核心是让用户用日常语言描述零件(比如&