feat(app and model): token consumption statistics of the cluster

This commit is contained in:
Timebomb2018
2026-02-02 19:01:11 +08:00
parent 3464573f17
commit 1224802ac6
5 changed files with 175 additions and 18 deletions

View File

@@ -678,6 +678,11 @@ class DraftRunService:
elapsed_time = time.time() - start_time
if sub_agent:
yield self._format_sse_event("sub_usage", {
"total_tokens": total_tokens
})
# 10. 保存会话消息
if not sub_agent and agent_config.memory and agent_config.memory.get("enabled"):
await self._save_conversation_message(