Skip to content

Commit

Permalink
Merge branch 'main' into willtai/sphinx-documentation-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
willtai authored May 7, 2024
2 parents 6cb3029 + 642bae9 commit 508ad72
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/patch-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Patch release 🚀

on:
workflow_dispatch:

jobs:
bump-version:
outputs:
version: ${{ steps.get-version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.2
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true

- name: Bump version
run: poetry version patch

- name: Get version
id: get-version
run: echo version=`poetry version -s` >> "$GITHUB_OUTPUT"
- name: Print varaibles
run: |
echo Version: ${{ steps.get-version.outputs.version }}
- uses: EndBug/add-and-commit@v9
with:
author_name: "Neo4j-GenAI GitHub Action"
author_email: "[email protected]"
message: "Bump version to ${{ steps.get-version.outputs.version }}"
add: "pyproject.toml"
tag: "${{ steps.get-version.outputs.version }}"
10 changes: 10 additions & 0 deletions src/neo4j_genai/retrievers/hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
from neo4j_genai.retrievers.base import Retriever
from neo4j_genai.types import HybridSearchModel, SearchType, HybridCypherSearchModel
from neo4j_genai.neo4j_queries import get_search_query
import logging

logger = logging.getLogger(__name__)


class HybridRetriever(Retriever):
Expand Down Expand Up @@ -88,6 +91,9 @@ def search(

search_query = get_search_query(SearchType.HYBRID, self.return_properties)

logger.debug("HybridRetriever Cypher parameters: %s", parameters)
logger.debug("HybridRetriever Cypher query: %s", search_query)

records, _, _ = self.driver.execute_query(search_query, parameters)
return records

Expand Down Expand Up @@ -167,5 +173,9 @@ def search(
search_query = get_search_query(
SearchType.HYBRID, retrieval_query=self.retrieval_query
)

logger.debug("HybridCypherRetriever Cypher parameters: %s", parameters)
logger.debug("HybridCypherRetriever Cypher query: %s", search_query)

records, _, _ = self.driver.execute_query(search_query, parameters)
return records
10 changes: 10 additions & 0 deletions src/neo4j_genai/retrievers/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
SearchType,
)
from neo4j_genai.neo4j_queries import get_search_query
import logging

logger = logging.getLogger(__name__)


class VectorRetriever(Retriever):
Expand Down Expand Up @@ -100,6 +103,9 @@ def search(

search_query = get_search_query(SearchType.VECTOR, self.return_properties)

logger.debug("VectorRetriever Cypher parameters: %s", parameters)
logger.debug("VectorRetriever Cypher query: %s", search_query)

records, _, _ = self.driver.execute_query(search_query, parameters)

try:
Expand Down Expand Up @@ -186,5 +192,9 @@ def search(
search_query = get_search_query(
SearchType.VECTOR, retrieval_query=self.retrieval_query
)

logger.debug("VectorCypherRetriever Cypher parameters: %s", parameters)
logger.debug("VectorCypherRetriever Cypher query: %s", search_query)

records, _, _ = self.driver.execute_query(search_query, parameters)
return records

0 comments on commit 508ad72

Please sign in to comment.