|
@@ -921,6 +921,19 @@ def fetch_adopted_tools_cases(query_id=None):
|
|
|
return sorted(set(cases))
|
|
return sorted(set(cases))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def route_tables(knowledge_types):
|
|
|
|
|
+ """知识类型标签 → 落表列表(有序去重)。
|
|
|
|
|
+ 工序/能力 → search_process;工具 → search_tools;两者都含写两表;空/None 兜底 search_process。
|
|
|
|
|
+ 评估是统一一套(同一 llm_evaluation blob),故同帖落多表不重复打分,只是多写一行。"""
|
|
|
|
|
+ kt = set(knowledge_types or [])
|
|
|
|
|
+ tables = []
|
|
|
|
|
+ if (kt & {"工序", "能力"}) or not kt:
|
|
|
|
|
+ tables.append("search_process")
|
|
|
|
|
+ if kt & {"工具"}:
|
|
|
|
|
+ tables.append("search_tools")
|
|
|
|
|
+ return tables
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
# ── 评估去重:复用 query 无关分,只重算 query 相关分(search_eval.py 用)──────────
|
|
# ── 评估去重:复用 query 无关分,只重算 query 相关分(search_eval.py 用)──────────
|
|
|
|
|
|
|
|
def fetch_existing_eval(case_id, table="search_process"):
|
|
def fetch_existing_eval(case_id, table="search_process"):
|