From f1098f0c7dcb1dd351320a9586358483079d8c1d Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Tue, 5 Aug 2025 22:19:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(kb=5Futils):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/knowledge/kb_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/knowledge/kb_utils.py b/src/knowledge/kb_utils.py index cebfd7f8..0d1cf606 100644 --- a/src/knowledge/kb_utils.py +++ b/src/knowledge/kb_utils.py @@ -49,8 +49,8 @@ def prepare_item_metadata(item: str, content_type: str, db_id: str) -> dict: file_path = Path(item) file_id = f"file_{hashstr(str(file_path) + str(time.time()), 6)}" file_type = file_path.suffix.lower().replace(".", "") - filename = os.path.relpath(file_path, Path.cwd()) - item_path = str(file_path) + filename = file_path.name + item_path = os.path.relpath(file_path, Path.cwd()) else: # URL file_id = f"url_{hashstr(item + str(time.time()), 6)}" file_type = "url"