Repository navigation
Replies: 1 comment
|
确实是很实用的提议 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
发现的问题
目前 Chat 中没有任何扩展点可以让 plugin 在 user message 的 action row 上添加 action。
举例:一个 plugin 想在 user message 下方、复制按钮旁边加一个“收藏这条提问”的按钮。现状是:
为什么是问题
“收藏这条提问”这类 action 的语义天然属于 user message——按钮必须挂在 user message 上,并且要拿到该消息的 seq / time / text。因此:
换而言之,slot 体系里 assistant 侧的 action row 已经有两个注入位,user 侧一个都没有,这是目前唯一没有注入点的那一格。
建议的方案
给 assistant-actions 补一个 user 侧的对称物:
'conversation.chat.user-actions': {
kind: 'list'
scope: 'session'
owner: { seq: number; time: number; text: string }
}
core 侧的接线只有三处小改动:
无注册时 action row 的渲染与现在完全一致;plugin 侧只需贡献一个组件——与现有 assistant 侧 action slot 完全相同的模式。
考虑过的替代方案:接受把按钮挂在 assistant 侧(语义错位),或覆盖 'user' node 渲染器(复制全部消息渲染逻辑)。两者都不如 core 里三行的 seam。
All reactions