Skip to content

Commit

Permalink
Added comment about Embedder type in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
willtai committed Apr 22, 2024
1 parent 2a21e0d commit 643d2a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/similarity_search_for_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
driver = GraphDatabase.driver(URI, auth=AUTH)


# Create Embedder object
# Create CustomEmbedder object with the required Embedder type
class CustomEmbedder(Embedder):
def embed_query(self, text: str) -> list[float]:
return [random() for _ in range(DIMENSION)]
Expand Down
6 changes: 4 additions & 2 deletions src/neo4j_genai/retrievers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def search(self, *args, **kwargs) -> Any:

class VectorRetriever(Retriever):
"""
Provides retrieval method using vector search over embeddings
Provides retrieval method using vector search over embeddings.
If an embedder is provided, it needs to have the required Embedder type.
"""

def __init__(
Expand Down Expand Up @@ -160,7 +161,8 @@ def search(

class VectorCypherRetriever(Retriever):
"""
Provides retrieval method using vector similarity and custom Cypher query
Provides retrieval method using vector similarity and custom Cypher query.
If an embedder is provided, it needs to have the required Embedder type.
"""

def __init__(
Expand Down

0 comments on commit 643d2a3

Please sign in to comment.