diff --git a/pyproject.toml b/pyproject.toml index b9f9e7daf..f09a8ed79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "neo4j-genai" -version = "0.1.0" +version = "0.1.1" description = "Python package to allow easy integration to Neo4j's GenAI features" authors = ["Neo4j, Inc "] license = "Apache License, Version 2.0" diff --git a/tests/test_client.py b/tests/test_client.py index 8d0614903..53f143140 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -3,6 +3,7 @@ from neo4j_genai.types import Neo4jRecord from unittest.mock import patch, MagicMock + def test_genai_client_supported_aura_version(driver): driver.execute_query.return_value = [[{"versions": ["5.11-aura"]}], None, None] @@ -85,6 +86,7 @@ def test_drop_index(client): {"name": "my-index"}, ) + @patch("neo4j_genai.GenAIClient._verify_version") def test_similarity_search_vector_happy_path(_verify_version_mock, driver): custom_embeddings = MagicMock() @@ -106,7 +108,9 @@ def test_similarity_search_vector_happy_path(_verify_version_mock, driver): YIELD node, score """ - records = client.similarity_search(name=index_name, query_vector=query_vector, top_k=top_k) + records = client.similarity_search( + name=index_name, query_vector=query_vector, top_k=top_k + ) custom_embeddings.embed_query.assert_not_called() @@ -145,7 +149,9 @@ def test_similarity_search_text_happy_path(_verify_version_mock, driver): YIELD node, score """ - records = client.similarity_search(name=index_name, query_text=query_text, top_k=top_k) + records = client.similarity_search( + name=index_name, query_text=query_text, top_k=top_k + ) custom_embeddings.embed_query.assert_called_once_with(query_text) @@ -186,6 +192,7 @@ def test_similarity_search_both_text_and_vector(client): top_k=top_k, ) + @patch("neo4j_genai.GenAIClient._verify_version") def test_similarity_search_vector_bad_results(_verify_version_mock, driver): custom_embeddings = MagicMock() @@ -208,7 +215,9 @@ def test_similarity_search_vector_bad_results(_verify_version_mock, driver): """ with pytest.raises(ValueError): - client.similarity_search(name=index_name, query_vector=query_vector, top_k=top_k) + client.similarity_search( + name=index_name, query_vector=query_vector, top_k=top_k + ) custom_embeddings.embed_query.assert_not_called()