了解如何在聊天体验中设计小部件。

快速设计小部件
在 A2UI Widget Builder 中使用小部件生成器试验卡片布局、列表行,并预览组件。完成满意的设计后,将生成的 JSON 复制到你的集成中,并从后端提供服务。小部件中间件
通过中间件配置,你可以让大模型通过工具调用或者结构化输出的方式返回 ChatKit 小部件给前端展示数据。使用中间件来动态更改小部件内容、样式或行为,以适应用户上下文或偏好。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.


chatkit.setOptions({
widgets: {
async onAction(action, item) {
await fetch('/api/widget-action', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action, itemId: item.id }),
});
},
},
});