Chatkit allows UI responses?

Is there a way to show/render ui tool responses with chatkit? My tools are working now with the chat gpt integration, but i dont see the way to use them into my chatkit integration.

2 Likes

ChatKit 本身并不会自动“渲染”工具(tool)返回的 UI。

在当前的设计里,ChatKit 主要负责渲染 message content(文本 / 富文本),而工具调用的结果通常是 结构化数据(如 JSON),需要由你的前端逻辑来解释和呈现。

常见的做法有两种:

  1. 在工具返回结果后,将其转换为一条普通的 assistant message(例如文本或 markdown),让 ChatKit 正常渲染;

  2. 在前端监听 tool call 的结果,根据返回的数据结构,使用你自己的 UI 组件(表格、卡片、按钮等)进行渲染,而不是依赖 ChatKit 自动处理。

换句话说,工具负责“算什么 / 返回什么”,ChatKit 负责“显示消息”,UI 的具体表现仍然需要你在应用层完成绑定。

建议把工具结果当作一个数据源,而不是直接可渲染的 UI 响应。

2 Likes