Skip to content

Commit 1dc0c42

Browse files
Adapt SimpleKGPipelineConfig
1 parent fd8d022 commit 1dc0c42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/neo4j_graphrag/experimental/pipeline/config/template_pipeline/simple_kg_builder.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
from neo4j_graphrag.experimental.components.text_splitters.fixed_size_splitter import (
3838
FixedSizeSplitter,
3939
)
40-
from neo4j_graphrag.experimental.components.types import LexicalGraphConfig
40+
from neo4j_graphrag.experimental.components.types import (
41+
LexicalGraphConfig,
42+
SchemaEnforcementMode
43+
)
4144
from neo4j_graphrag.experimental.pipeline.config.object_config import ComponentType
4245
from neo4j_graphrag.experimental.pipeline.config.template_pipeline.base import (
4346
TemplatePipelineConfig,
@@ -71,6 +74,7 @@ class SimpleKGPipelineConfig(TemplatePipelineConfig):
7174
entities: Sequence[EntityInputType] = []
7275
relations: Sequence[RelationInputType] = []
7376
potential_schema: Optional[list[tuple[str, str, str]]] = None
77+
enforce_schema: SchemaEnforcementMode = SchemaEnforcementMode.NONE
7478
on_error: OnError = OnError.IGNORE
7579
prompt_template: Union[ERExtractionTemplate, str] = ERExtractionTemplate()
7680
perform_entity_resolution: bool = True
@@ -124,6 +128,7 @@ def _get_extractor(self) -> EntityRelationExtractor:
124128
return LLMEntityRelationExtractor(
125129
llm=self.get_default_llm(),
126130
prompt_template=self.prompt_template,
131+
enforce_schema=self.enforce_schema,
127132
on_error=self.on_error,
128133
)
129134

0 commit comments

Comments
 (0)