From d636d6ea7a3c1904995ccff15d8d29d1b4b1b6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=97=AD=E8=BE=89?= <2569429256@qq.com> Date: Mon, 3 Nov 2025 09:46:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(vector):=20=E4=BF=AE=E5=A4=8D=20source=5Fty?= =?UTF-8?q?pe=20=E5=88=A4=E6=96=AD=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 source_type 转换为字符串后再与枚举值比较 - 避免了类型不匹配导致的判断错误 - 确保了数据分块功能的正常运行 --- apps/knowledge/vector/base_vector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/knowledge/vector/base_vector.py b/apps/knowledge/vector/base_vector.py index 92f250038..2a7731fce 100644 --- a/apps/knowledge/vector/base_vector.py +++ b/apps/knowledge/vector/base_vector.py @@ -21,7 +21,7 @@ lock = threading.Lock() def chunk_data(data: Dict): - if str(data.get('source_type')) == SourceType.PARAGRAPH.value: + if str(data.get('source_type')) == str(SourceType.PARAGRAPH.value): text = data.get('text') chunk_list = text_to_chunk(text) return [{**data, 'text': chunk} for chunk in chunk_list]