功能:接入 prompt_tokens_details.cached_tokens,消息与模型统计展示缓存命中
- engine: assistant 落库与 SSE 事件带 usage {pt,ct,cached}(上游未报 details 时 cached=null 区分未上报与 0 命中);recordModelUsage 写 cached_tokens;modelUsageStats 聚合 today_cached/total_cached
- db: messages 加 usage TEXT、model_usage 加 cached_tokens 列(建表+迁移双路径,幂等)
- server: /api/pool 统计行透传 today_cached/total_cached
- 前端 msg-actions: 时间戳后新增「In: 1.2k/95%, Out: 456」小字(title 显示精确 tok 数),历史/SSE/摘要卡片三处渲染同参
- 模型卡新增「缓存命中」行:累计缓存 tok · 历史命中率(累计缓存÷累计输入)
This commit is contained in:
@@ -268,6 +268,8 @@ main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
||||
margin-top: 6px; font-size: 12px; color: var(--gray-light);
|
||||
}
|
||||
.msg-actions .act { display: flex; color: var(--gray-light); padding: 3px; border-radius: 6px; }
|
||||
/* token 用量小字(In/Out/缓存命中率),不抢时间戳视觉 */
|
||||
.msg-actions .act-usage { font-size: 11px; white-space: nowrap; }
|
||||
.msg-actions .act:active, .msg-actions .act:hover { color: var(--ink); }
|
||||
.msg-actions .act.copied { color: var(--active); }
|
||||
/* 删除本条:悬停变红点明破坏性;禁用态(请求中)半透且不响应 */
|
||||
|
||||
Reference in New Issue
Block a user