Skip to content

Commit

Permalink
Improve log warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdeleong committed Sep 4, 2024
1 parent 21e7def commit c68d44e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion retrieval_service/datastore/providers/neo4j_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ async def amenities_search(
self, query_embedding: list[float], similarity_threshold: float, top_k: int
) -> tuple[list[dict], Optional[str]]:

logging.warning(f"Overriding top_k value to 2. Provided value was {top_k}.")
logging.warning(
f"top_k set to {top_k}; for GraphRAG, overriding top_k to 2 to limit search results."
)

async with self.__driver.session() as session:
# OPTIONAL ensures that all similar amenities are returned even if they lack a SIMILAR_TO relationship
Expand Down
6 changes: 6 additions & 0 deletions retrieval_service/datastore/providers/neo4j_graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ async def test_amenities_search(
top_k: int,
expected: List[Any],
):
<<<<<<< HEAD
res, sql = await ds.amenities_search(query_embedding, similarity_threshold, top_k)
=======

res, sql = await ds.amenities_search(query_embedding, similarity_threshold, top_k)

>>>>>>> 06e09fa (Improve log warning)
assert res == expected
assert sql is None

0 comments on commit c68d44e

Please sign in to comment.