fix(exam): 正确返回文件未索引错误

This commit is contained in:
User
2026-07-19 14:25:40 +08:00
parent d7fb98faf6
commit df33a912af
6 changed files with 252 additions and 28 deletions

View File

@@ -100,7 +100,7 @@ def check_file_indexed(file_path: str, collection: str) -> Dict:
}
# 提取文件名
filename = os.path.basename(file_path)
filename = os.path.basename(file_path.replace("\\", "/"))
# 查询向量库
collections = [collection] if isinstance(collection, str) else list(collection) if collection else []
@@ -356,7 +356,7 @@ def retrieve_file_chunks_for_analysis(
collections = [collection] if isinstance(collection, str) else collection
# 提取文件名(向量库存储的是文件名,不含路径前缀)
filename = os.path.basename(file_path)
filename = os.path.basename(file_path.replace("\\", "/"))
# 向量检索(尝试文件名和完整路径)
results = None
@@ -424,7 +424,7 @@ def retrieve_file_chunks(
query = build_semantic_query(question_types)
# 提取文件名(向量库存储的是文件名,不含路径前缀)
filename = os.path.basename(file_path)
filename = os.path.basename(file_path.replace("\\", "/"))
# 统一处理为列表
if isinstance(collection, str):