了解如何在聊天体验中设计小部件。
默认
小部件
小部件是 ChatKit 提供的容器和组件。你可以使用预构建的小部件、修改模板或自行设计,以便在产品中完全自定义 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 }),
});
},
},
});