refactor(backend): 重构后端

This commit is contained in:
sophie committed 2026-07-01 21:18:35 +08:00
1 parent c8054476c1
commit bba6e6f221
32 files changed
+252 -296

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ backend/app/services/hot_faq_aggregator.py
用途:从 ChatLog 离线聚合热点 FAQ 候选,写入 PostgreSQL 候选表(不含在线命中)。
依赖:ChatLog、Feedback、QuickQuestion、faq_text_utils、hot_faq_candidate_store。
逻辑:CLI `flask faq-aggregate-hot` 与管理端「刷新」调用 aggregate_hot_faq_candidates。
逻辑:管理端「刷新聚合」调用 aggregate_hot_faq_candidates。
## 热点选取规则(HOT_FAQ_SELECTION_RULES)
@@ -17,7 +17,7 @@ ScheduleExecuteResult = tuple[int, int, int, int, list[dict[str, Any]], list[str
def run_faq_hot_aggregate_schedule(task: ScheduleTask, run: ScheduleRun) -> ScheduleExecuteResult:
"""
执行 FAQ 热点离线聚合(等同 flask faq-aggregate-hot,非 dry-run)。
执行 FAQ 热点离线聚合(非 dry-run)。
核心逻辑:委托 HotFaqAggregator;可选 dify_agent_id 限定 Agent。
@param task - 排程任务;dify_agent_id 可选作 agent_id 过滤
@param run - 当前执行批次(未写入 run 字段,由 scheduler_service 汇总)