Skip to content

Commit

Permalink
Updated E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexthomas93 committed Sep 18, 2024
1 parent 2521cd0 commit 2f99260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FixedSizeSplitter(TextSplitter):
Args:
chunk_size (int): The number of characters in each chunk.
chunk_overlap (int): The number of characters to overlap between chunks. Must be less than `chunk_size`.
chunk_overlap (int): The number of characters from the previous chunk to overlap with each chunk. Must be less than `chunk_size`.
Example:
Expand Down
13 changes: 5 additions & 8 deletions tests/e2e/test_kg_builder_pipeline_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import neo4j
import pytest
from langchain_text_splitters import CharacterTextSplitter
from neo4j_graphrag.embedder import Embedder
from neo4j_graphrag.exceptions import LLMGenerationError
from neo4j_graphrag.experimental.components.embedder import TextChunkEmbedder
Expand All @@ -35,8 +34,8 @@
SchemaProperty,
SchemaRelation,
)
from neo4j_graphrag.experimental.components.text_splitters.langchain import (
LangChainTextSplitterAdapter,
from neo4j_graphrag.experimental.components.text_splitters.fixed_size_splitter import (
FixedSizeSplitter,
)
from neo4j_graphrag.experimental.pipeline import Pipeline
from neo4j_graphrag.experimental.pipeline.pipeline import PipelineResult
Expand All @@ -63,10 +62,8 @@ def schema_builder() -> SchemaBuilder:


@pytest.fixture
def text_splitter() -> LangChainTextSplitterAdapter:
return LangChainTextSplitterAdapter(
CharacterTextSplitter(chunk_size=50, chunk_overlap=10, separator="\n\n")
)
def text_splitter() -> FixedSizeSplitter:
return FixedSizeSplitter(chunk_size=500, chunk_overlap=100)


@pytest.fixture
Expand All @@ -89,7 +86,7 @@ def kg_writer(driver: neo4j.Driver) -> Neo4jWriter:

@pytest.fixture
def kg_builder_pipeline(
text_splitter: LangChainTextSplitterAdapter,
text_splitter: FixedSizeSplitter,
chunk_embedder: TextChunkEmbedder,
schema_builder: SchemaBuilder,
entity_relation_extractor: LLMEntityRelationExtractor,
Expand Down

0 comments on commit 2f99260

Please sign in to comment.