|
|
@@ -958,6 +958,16 @@ def fetch_existing_eval(case_id, table="search_process"):
|
|
|
return None
|
|
|
|
|
|
|
|
|
+def fetch_existing_eval_any(case_id):
|
|
|
+ """跨两张搜索表找该 case 最近一条有效评估 blob。
|
|
|
+ 评估与表无关(统一一套),任一表评过即可复用,避免同帖在两表各评一次。无则 None。"""
|
|
|
+ for table in ("search_process", "search_tools"):
|
|
|
+ e = fetch_existing_eval(case_id, table)
|
|
|
+ if e:
|
|
|
+ return e
|
|
|
+ return None
|
|
|
+
|
|
|
+
|
|
|
def update_post_eval(query_id, case_id, evaluation, table="search_process"):
|
|
|
"""用新的评估 blob 覆盖某 (query, case) 行的 llm_evaluation,并同步重算派生列
|
|
|
overall_score、knowledge_type(口径同 upsert_search_posts)。返回受影响行数。"""
|