Skip to content

Commit

Permalink
Fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Oct 4, 2024
1 parent 046c0cf commit d064c47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from llama_index.vector_stores.falkordb import FalkorDBVectorStore
from llama_index.vector_stores.falkordb.base import FalkorDBVectorStore

__all__ = ["FalkorDBVectorStore"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, List
from typing import Any, Dict, List, Optional
import logging

from falkordb import FalkorDB
Expand Down Expand Up @@ -81,14 +81,15 @@ class FalkorDBVectorStore(BasePydanticVectorStore):

def __init__(
self,
url: str,
url: Optional[str] = None,
database: str = "falkor",
index_name: str = "vector",
node_label: str = "Chunk",
embedding_node_property: str = "embedding",
text_node_property: str = "text",
distance_strategy: str = "cosine",
embedding_dimension: int = 1536,
driver: Optional[FalkorDB] = None,
**kwargs: Any,
) -> None:
super().__init__(
Expand All @@ -103,7 +104,7 @@ def __init__(
if distance_strategy not in ["cosine", "euclidean"]:
raise ValueError("distance_strategy must be either 'euclidean' or 'cosine'")

self._driver = FalkorDB.from_url(url).select_graph(database)
self._driver = driver or FalkorDB.from_url(url).select_graph(database)
self._database = database

# Inline check_if_not_null function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from llama_index.core.schema import TextNode
from llama_index.vector_stores.falkordb import FalkorDBVectorStore
from llama_index.vector_stores.types import (
from llama_index.core.vector_stores.types import (
VectorStoreQuery,
MetadataFilters,
ExactMatchFilter,
Expand Down Expand Up @@ -50,7 +50,7 @@ def mock_falkordb():
@pytest.fixture()
def falkordb_store(mock_falkordb):
return FalkorDBVectorStore(
url="bolt://localhost:7687",
driver=mock_falkordb,
database="testdb",
index_name="test_index",
node_label="Chunk",
Expand Down

1 comment on commit d064c47

@A5jadAli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@logan-markewich please let me know if you need any help in the code or docs, I would love to help.

Please sign in to comment.