Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/pipeline/kg_builder_with_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import logging
from typing import Any

from neo4j_genai.kg_construction.schema import (
from neo4j_genai.components.schema import (
SchemaBuilder,
SchemaEntity,
SchemaRelation,
Expand Down
14 changes: 14 additions & 0 deletions src/neo4j_genai/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
# #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# #
# https://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
3 changes: 2 additions & 1 deletion src/neo4j_genai/components/kg_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
from typing import Literal, Optional

import neo4j
from pydantic import validate_call

from neo4j_genai.components.types import Neo4jGraph, Neo4jNode, Neo4jRelationship
from neo4j_genai.indexes import upsert_vector, upsert_vector_on_relationship
from neo4j_genai.neo4j_queries import UPSERT_NODE_QUERY, UPSERT_RELATIONSHIP_QUERY
from neo4j_genai.pipeline.component import Component, DataModel
from pydantic import validate_call


class KGWriterModel(DataModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@

from typing import Any, Dict, List, Literal, Tuple

from pydantic import BaseModel, ValidationError, model_validator, validate_call

from neo4j_genai.exceptions import SchemaValidationError
from neo4j_genai.pipeline import Component, DataModel
from pydantic import BaseModel, ValidationError, model_validator, validate_call


class SchemaProperty(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions src/neo4j_genai/components/text_splitters/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

from langchain_text_splitters import TextSplitter as LangChainTextSplitter

from neo4j_genai.components.text_splitters.base import TextSplitter
from neo4j_genai.components.types import TextChunk, TextChunks

Expand Down
1 change: 1 addition & 0 deletions src/neo4j_genai/components/text_splitters/llamaindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

from llama_index.core.node_parser import TextSplitter as LlamaIndexTextSplitter

from neo4j_genai.components.text_splitters.base import TextSplitter
from neo4j_genai.components.types import TextChunk, TextChunks

Expand Down
3 changes: 2 additions & 1 deletion src/neo4j_genai/components/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

from typing import Any, Optional

from neo4j_genai.pipeline.component import DataModel
from pydantic import BaseModel, field_validator

from neo4j_genai.pipeline.component import DataModel


class TextChunk(BaseModel):
"""A chunk of text split from a document by a text splitter.
Expand Down
Empty file.
14 changes: 14 additions & 0 deletions tests/unit/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
# #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# #
# https://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
from __future__ import annotations

import pytest
from neo4j_genai.exceptions import SchemaValidationError
from neo4j_genai.kg_construction.schema import (
from neo4j_genai.components.schema import (
SchemaBuilder,
SchemaEntity,
SchemaProperty,
SchemaRelation,
)
from neo4j_genai.exceptions import SchemaValidationError
from pydantic import ValidationError


Expand Down