Skip to content

Commit d636d6e

Browse files
kejizhilianliuruibin
authored andcommitted
fix(vector): 修复 source_type 判断类型问题
- 将 source_type 转换为字符串后再与枚举值比较 - 避免了类型不匹配导致的判断错误 - 确保了数据分块功能的正常运行
1 parent fcd258d commit d636d6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/knowledge/vector/base_vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
def chunk_data(data: Dict):
24-
if str(data.get('source_type')) == SourceType.PARAGRAPH.value:
24+
if str(data.get('source_type')) == str(SourceType.PARAGRAPH.value):
2525
text = data.get('text')
2626
chunk_list = text_to_chunk(text)
2727
return [{**data, 'text': chunk} for chunk in chunk_list]

0 commit comments

Comments
 (0)