fix(api): default delimiter must be a real newline, not the r"\n" escape (#17591)

This commit is contained in:
deadtrickster
2026-08-04 10:16:34 +02:00
committed by GitHub
parent 404b47c79e
commit 8c8c1e7df7
3 changed files with 53 additions and 3 deletions

View File

@@ -390,7 +390,7 @@ def get_parser_config(chunk_method, parser_config):
"one": None,
"knowledge_graph": {
"chunk_token_num": 8192,
"delimiter": r"\n",
"delimiter": "\n",
"entity_types": ["organization", "person", "location", "event", "time"],
"raptor": {"use_raptor": False},
"graphrag": {"use_graphrag": False},

View File

@@ -425,7 +425,7 @@ class ParentChildConfig(Base):
"""Dataset parser configuration for parent-child chunking."""
use_parent_child: Annotated[bool, Field(default=False)]
children_delimiter: Annotated[str, Field(default=r"\n", min_length=1)]
children_delimiter: Annotated[str, Field(default="\n", min_length=1)]
class AutoMetadataField(Base):
@@ -453,7 +453,7 @@ class ParserConfig(Base):
auto_keywords: Annotated[int, Field(default=0, ge=0, le=32)]
auto_questions: Annotated[int, Field(default=0, ge=0, le=10)]
chunk_token_num: Annotated[int, Field(default=512, ge=1, le=2048)]
delimiter: Annotated[str, Field(default=r"\n", min_length=1)]
delimiter: Annotated[str, Field(default="\n", min_length=1)]
graphrag: Annotated[GraphragConfig, Field(default_factory=lambda: GraphragConfig(use_graphrag=False))]
html4excel: Annotated[bool, Field(default=False)]
layout_recognize: Annotated[str, Field(default="DeepDOC")]