refactor: unify core pipeline logging with cs_agent logger

This commit is contained in:
2026-03-01 16:29:52 +08:00
parent a6b7bf1982
commit 8dd5a11b4b
11 changed files with 82 additions and 55 deletions

View File

@@ -1,9 +1,12 @@
from __future__ import annotations
import os
import logging
from collections import Counter
from datetime import datetime
logger = logging.getLogger("cs_agent")
def calc_avg_complexity(complexity_history: list) -> str:
"""计算平均复杂度。"""
@@ -153,7 +156,7 @@ def get_customer_profile_context(agent, customer_id: str) -> str:
return "\n".join(lines)
except Exception as e:
print(f"[Agent] 获取客户画像失败: {e}")
logger.exception("[Agent] 获取客户画像失败: %s", e)
return ""