fix: Token统计准确性修复 + 仪表盘增强

1. 修复eval_count只记最后一轮的bug:改为每轮累加
2. 新增prompt_eval_count(输入token)统计
3. 修复total_duration使用Ollama实际推理时间而非墙钟时间
4. 数据库messages表新增prompt_eval_count列(含兼容迁移)
5. 仪表盘显示输入/输出token分项统计
6. 柱状图堆叠显示输入(紫色)+输出(橙色)比例
7. 明细表格新增输入/输出/合计三列
This commit is contained in:
thzxx
2026-04-23 16:11:17 +08:00
parent e96b2a840e
commit 21b9a14824
8 changed files with 125 additions and 29 deletions
+2
View File
@@ -36,6 +36,7 @@ export interface OllamaStreamChunk {
};
done?: boolean;
eval_count?: number;
prompt_eval_count?: number;
total_duration?: number;
}
@@ -99,6 +100,7 @@ export interface ChatMessage {
model?: string;
think?: string;
eval_count?: number;
prompt_eval_count?: number;
total_duration?: number;
images?: string[];
files?: ChatFile[];