fix(vector): 修复 source_type 判断类型问题
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

- 将 source_type 转换为字符串后再与枚举值比较
- 避免了类型不匹配导致的判断错误
- 确保了数据分块功能的正常运行
This commit is contained in:
王旭辉 2025-11-03 09:46:22 +08:00 committed by 刘瑞斌
parent fcd258d05c
commit d636d6ea7a

View File

@ -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]