体验:tool_call 参数流式早反馈——id+name 就绪即建卡,参数碎片增量下发实时填充

- llm.js callModel:tool_call 碎片凑齐 id+name 时触发 onToolCallStart,其后参数按增量触发 onToolCallArgs(announced/announcedLen 按 slot 去重)
- engine.js streamAssistant:接回调广播 tool_call_start / tool_call_args 两个 SSE 事件
- 前端:tool_call_start 即建展开态「生成参数中…」早卡(顺带解决原 tool_call 事件因 assistant_message 先建卡而永远收起的问题);tool_call_args 150ms 节流流式填参数区+字符计数
- 收尾:assistant_message / 执行时 tool_call 带完整(解包后)参数回填 finalizeToolCardArgs;done 异常兜底回填,防占位态永久呼吸;toolCallStreaming 随会话/回合各处重置
- CSS:.tool-generating 的 ◌ 呼吸动画
- 修复写坏的复制按钮 SVG path(上一轮 fuzzy 编辑吞字),与 HEAD 比对还原
This commit is contained in:
2026-09-10 09:46:28 +08:00
parent 695abf1f6a
commit 62c114258c
4 changed files with 93 additions and 5 deletions
+4
View File
@@ -288,6 +288,10 @@ footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0
}
.attach-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.attach-chip .rm { color: var(--gray); display: flex; }
/* 工具卡参数流式生成中:◌ 呼吸提示(收尾后随 .tool-generating 移除) */
.tool-card.tool-generating .spin { display: inline-block; color: var(--active); animation: tool-gen-pulse 1s ease-in-out infinite; }
@keyframes tool-gen-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }
/* 上传文件卡片行(嵌在输入框内部顶端,由 .input-shell 的 gap 提供间距;逐卡进度遮罩;卡多时横向滚动) */
.up-cards {
display: flex; gap: 6px;