From a53510bc41cda3733a284fdb97781bde0bfa659a Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 24 Oct 2025 14:27:01 +0800 Subject: [PATCH] refactor: comment out file path handling in KBHelper and search input in DocumentDetail --- astrbot/core/knowledge_base/kb_helper.py | 13 +++++++------ .../src/views/knowledge-base/DocumentDetail.vue | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/astrbot/core/knowledge_base/kb_helper.py b/astrbot/core/knowledge_base/kb_helper.py index 4141b403b..e6cef61be 100644 --- a/astrbot/core/knowledge_base/kb_helper.py +++ b/astrbot/core/knowledge_base/kb_helper.py @@ -118,9 +118,9 @@ class KBHelper: media_paths: list[Path] = [] vec_doc_ids = [] - file_path = self.kb_files_dir / f"{doc_id}.{file_type}" - async with aiofiles.open(file_path, "wb") as f: - await f.write(file_content) + # file_path = self.kb_files_dir / f"{doc_id}.{file_type}" + # async with aiofiles.open(file_path, "wb") as f: + # await f.write(file_content) try: parser = self.parsers.get(file_type) @@ -164,7 +164,8 @@ class KBHelper: doc_name=file_name, file_type=file_type, file_size=len(file_content), - file_path=str(file_path), + # file_path=str(file_path), + file_path="", chunk_count=len(chunks_text), media_count=0, ) @@ -183,8 +184,8 @@ class KBHelper: return doc except Exception as e: logger.error(f"上传文档失败: {e}") - if file_path.exists(): - file_path.unlink() + # if file_path.exists(): + # file_path.unlink() for media_path in media_paths: try: diff --git a/dashboard/src/views/knowledge-base/DocumentDetail.vue b/dashboard/src/views/knowledge-base/DocumentDetail.vue index e99d1a75d..fb64e628c 100644 --- a/dashboard/src/views/knowledge-base/DocumentDetail.vue +++ b/dashboard/src/views/knowledge-base/DocumentDetail.vue @@ -85,7 +85,7 @@ {{ totalChunks }} {{ t('chunks.title') }} - + /> -->