Merge remote-tracking branch 'origin/ai-hub' into ai-hub

This commit is contained in:
Gsh
2026-01-24 15:48:30 +08:00
6 changed files with 180 additions and 16 deletions

View File

@@ -235,12 +235,16 @@ function handleAgentChunk(data: AgentResultOutput) {
case 'toolCalling':
// 工具调用中
if (!latest.toolCalls) latest.toolCalls = [];
latest.toolCalls.push({
const newToolCall: { name: string; status: 'calling' | 'called'; result?: any; usage?: { prompt: number; completion: number; total: number } } = {
name: data.content as string,
status: 'calling',
});
// 清空待处理的用量
pendingToolUsage = null;
};
// 如果有待处理的用量toolCallUsage 先于 toolCalling 到达),设置到这个工具调用
if (pendingToolUsage) {
newToolCall.usage = pendingToolUsage;
pendingToolUsage = null;
}
latest.toolCalls.push(newToolCall);
break;
case 'toolCallUsage':
// 工具调用用量统计 - 先保存,等 toolCalled 时再设置
@@ -626,6 +630,23 @@ function cancelSSE() {
flex: 1;
overflow-y: auto;
padding: 8px;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: var(--el-border-color-lighter);
border-radius: 2px;
&:hover {
background: var(--el-border-color);
}
}
}
.session-item {