[modify] Optimize ES connections and add rerank security checks

This commit is contained in:
Mark
2026-04-14 16:46:57 +08:00
parent 19fa8314e4
commit fcf3071cb0
4 changed files with 84 additions and 111 deletions

View File

@@ -113,7 +113,7 @@ def knowledge_retrieval(
continue
# Use the specified reranker for re-ranking
if reranker_id:
if reranker_id and all_results:
try:
all_results = rerank(db=db, reranker_id=reranker_id, query=query, docs=all_results, top_k=reranker_top_k)
except Exception as rerank_error: