实现今日/累计token用量统计;任务删除按钮与技能页统一;加载更多按钮样式重做

This commit is contained in:
2026-09-02 00:07:07 +08:00
parent 23d7e89212
commit 7682f696cc
9 changed files with 89 additions and 17 deletions
+3
View File
@@ -17,6 +17,8 @@ function streamText(res, text, delayMs) {
if (!queue.length) {
clearInterval(timer);
sse(res, { choices: [{ delta: {}, finish_reason: 'stop' }] });
// 尾声 usage 帧(OpenAI stream_options.include_usage 行为),供 token 用量统计测试
sse(res, { usage: { prompt_tokens: 100, completion_tokens: 20, total_tokens: 120 } });
res.write('data: [DONE]\n\n');
res.end();
return;
@@ -33,6 +35,7 @@ function streamToolCall(res) {
sse(res, { choices: [{ delta: { tool_calls: [{ function: { arguments: '{"path": "hello.txt",' } }] } }] });
sse(res, { choices: [{ delta: { tool_calls: [{ function: { arguments: ' "content": "hello from agent"}' } }] } }] });
sse(res, { choices: [{ delta: {}, finish_reason: 'tool_calls' }] });
sse(res, { usage: { prompt_tokens: 80, completion_tokens: 40, total_tokens: 120 } });
res.write('data: [DONE]\n\n');
res.end();
}