我学习到的AG-UI的功能:全面的交互支持

AG-UI提供了智能体和应用交互所需的几乎所有功能:

1. 流式聊天

bash 复制代码
{
  type: "message",
  role: "assistant",
  content: "正在为您查找...",
  streaming: true
}

2. 状态同步

css 复制代码
{
  type: "state_sync",
  state: {
    searchQuery: "中餐厅",
    results: [...]
  }
}

3. 生成式UI

bash 复制代码
{
  type: "generative_ui",
  component: "RestaurantCard",
  props: {...}
}

4. 工具调用

matlab 复制代码
{
  type: "tool_call",
  tool: "search_restaurants",
  arguments: {...}
}

5. 前端工具

bash 复制代码
{
  type: "frontend_action",
  action: "open_map",
  params: {...}
}

6. 人机协作(HITL)

bash 复制代码
{
  type: "interrupt",
  reason: "需要用户确认",
  options: [...]
}

7. 思考步骤

bash 复制代码
{
  type: "thinking",
  content: "正在分析用户需求..."
}

8. 多模态支持

less 复制代码
{
  type: "message",
  content: "这是餐厅照片",
  attachments: [{
    type: "image",
    url: "..."
  }]
}

9. 集成方式

ini 复制代码
# 使用LangGraph中间件
from copilotkit import CopilotKitSDK
 
sdk = CopilotKitSDK(
    agents=[my_langgraph_agent]
)

AG-UI可以传输A2UI消息

css 复制代码
// AG-UI事件中包含A2UI消息
{
  type: "generative_ui",
  format: "a2ui",
  content: {
    surfaceUpdate: {
      components: [...]
    }
  }
}
相关推荐
小徐_23337 小时前
Wot UI 2.2.0 发布:Button 新增 subtle,VideoPreview 预览体验继续增强
前端·微信小程序·uni-app
天蓝色的鱼鱼9 小时前
关于 CSS 你可能不知道的属性,但关键时刻很有用
前端·css
泯泷10 小时前
第 2 篇:设计第一套字节码:Opcode、Instruction 与 Constant Pool
前端·javascript·安全
妙码生花10 小时前
从 PHP 到 AI + Golang,程序员自救转型手记(十五):优化细节、网络请求封装
前端·后端·ai编程
泯泷10 小时前
第 1 篇:从 1 + 2 开始:亲手写出第一台 JSVM
前端·javascript·安全
团团崽_七分甜10 小时前
Spring Boot 核心知识点总结
前端
lichenyang45311 小时前
从一个按钮开始,理解 ASCF 框架到底在做什么
前端
古夕11 小时前
第三方 SSO 接入实践:redirect_uri 编码、回调一致性与跨项目联调
前端·vue.js
朦胧之11 小时前
页面白屏卡住排查方法
前端·javascript