Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix text split (#15426)

Jyongf77f7e143756
diff --git a/api/core/rag/splitter/fixed_text_splitter.py b/api/core/rag/splitter/fixed_text_splitter.py
index 2d99cce513d..5d34c801130 100644
--- a/api/core/rag/splitter/fixed_text_splitter.py
+++ b/api/core/rag/splitter/fixed_text_splitter.py
@@ -88,7 +88,10 @@ class FixedRecursiveCharacterTextSplitter(EnhanceRecursiveCharacterTextSplitter)
break
# Now that we have the separator, split the text
if separator:
- splits = text.split(separator)
+ if separator == " ":
+ splits = text.split()
+ else:
+ splits = text.split(separator)
else:
splits = list(text)
# Now go merging things, recursively splitting longer texts.