Skip to content

Commit

Permalink
Actually removes neo4j_graphrag.utils.execute_query
Browse files Browse the repository at this point in the history
  • Loading branch information
alexthomas93 committed Oct 23, 2024
1 parent 609ef51 commit 7be7f3a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/neo4j_graphrag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,11 @@
# limitations under the License.
from __future__ import annotations

from typing import Any, Optional

import neo4j
from typing import Optional


def validate_search_query_input(
query_text: Optional[str] = None, query_vector: Optional[list[float]] = None
) -> None:
if not (bool(query_vector) ^ bool(query_text)):
raise ValueError("You must provide exactly one of query_vector or query_text.")


async def execute_query(
driver: neo4j.Driver | neo4j.AsyncDriver, query: str, **kwargs: Any
) -> Any:
if isinstance(driver, neo4j.AsyncDriver):
result = await driver.execute_query(query, **kwargs)
else:
result = driver.execute_query(query, **kwargs)
return result

0 comments on commit 7be7f3a

Please sign in to comment.