From c93ff58ce741853a7ed0d4c88f675042cc32ecd0 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Fri, 19 Apr 2024 11:17:02 +0200 Subject: [PATCH] Add dev instructions to README --- README.md | 24 ++++++++++++++++++++++-- src/neo4j_genai/retrievers.py | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7909f49ef..23e59da5b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ pip install neo4j-genai ``` ## Example + After setting up a Neo4j database instance: + ```python from neo4j import GraphDatabase from neo4j_genai import VectorRetriever @@ -64,6 +66,24 @@ print(retriever.search(query_vector=query_vector, top_k=5)) ``` +# Development + +## Install dependencies + +```bash +poetry install +``` + +## Run tests + +Open a new virtual enviroment and then run the tests. + +```bash +poetry shell +pytest +``` + ## Further information -- [The official Neo4j Python driver](https://github.com/neo4j/neo4j-python-driver) -- [Neo4j GenAI integrations](https://neo4j.com/docs/cypher-manual/current/genai-integrations/) + +- [The official Neo4j Python driver](https://github.com/neo4j/neo4j-python-driver) +- [Neo4j GenAI integrations](https://neo4j.com/docs/cypher-manual/current/genai-integrations/) diff --git a/src/neo4j_genai/retrievers.py b/src/neo4j_genai/retrievers.py index 8d8e38c6e..2653ba66e 100644 --- a/src/neo4j_genai/retrievers.py +++ b/src/neo4j_genai/retrievers.py @@ -160,6 +160,7 @@ def search( query_vector (Optional[list[float]], optional): The vector embeddings to get the closest neighbors of. Defaults to None. query_text (Optional[str], optional): The text to get the closest neighbors of. Defaults to None. top_k (int, optional): The number of neighbors to return. Defaults to 5. + query_params (Optional[dict[str, Any]], optional): Parameters for the Cypher query. Defaults to None. Raises: ValueError: If validation of the input arguments fail.