From a6ec10a1ee1fa5aa505c26754cb0f69d1e1f5620 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Fri, 3 May 2024 17:09:29 +0200 Subject: [PATCH 1/3] Add initial version of release action --- .github/workflows/patch-release.yaml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/patch-release.yaml diff --git a/.github/workflows/patch-release.yaml b/.github/workflows/patch-release.yaml new file mode 100644 index 000000000..275a4ebbd --- /dev/null +++ b/.github/workflows/patch-release.yaml @@ -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: "team-gen-ai@neo4j.com" + # message: "Bump version to ${{ steps.get-version.outputs.version }}}" + # add: "pyproject.toml" + # tag: "${{ steps.get-version.outputs.version }}" From 78318e6cafae8463d2269b45010bc6d138069e92 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Fri, 3 May 2024 18:24:20 +0200 Subject: [PATCH 2/3] Exit dry run mode (#26) --- .github/workflows/patch-release.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/patch-release.yaml b/.github/workflows/patch-release.yaml index 275a4ebbd..8a6395b31 100644 --- a/.github/workflows/patch-release.yaml +++ b/.github/workflows/patch-release.yaml @@ -32,10 +32,10 @@ jobs: - 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: "team-gen-ai@neo4j.com" - # message: "Bump version to ${{ steps.get-version.outputs.version }}}" - # add: "pyproject.toml" - # tag: "${{ steps.get-version.outputs.version }}" + - uses: EndBug/add-and-commit@v9 + with: + author_name: "Neo4j-GenAI GitHub Action" + author_email: "team-gen-ai@neo4j.com" + message: "Bump version to ${{ steps.get-version.outputs.version }}" + add: "pyproject.toml" + tag: "${{ steps.get-version.outputs.version }}" From 642bae975c751e4f78980732aabd59beb724cfb6 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Tue, 7 May 2024 11:20:07 +0200 Subject: [PATCH 3/3] Add debug logging in retrievers (#28) * Add debug logging in retrievers We do not set any basic config on the loggers, but leave that for aplication developers to keep the log format consistent with their existing ones. * Drop value serialization and leave that to the logger * Add string placeholder in logger message * Improve log message --- src/neo4j_genai/retrievers/hybrid.py | 10 ++++++++++ src/neo4j_genai/retrievers/vector.py | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/neo4j_genai/retrievers/hybrid.py b/src/neo4j_genai/retrievers/hybrid.py index a9311d069..0690555a2 100644 --- a/src/neo4j_genai/retrievers/hybrid.py +++ b/src/neo4j_genai/retrievers/hybrid.py @@ -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): @@ -83,6 +86,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 @@ -157,5 +163,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 diff --git a/src/neo4j_genai/retrievers/vector.py b/src/neo4j_genai/retrievers/vector.py index 771ce3520..954cd04ed 100644 --- a/src/neo4j_genai/retrievers/vector.py +++ b/src/neo4j_genai/retrievers/vector.py @@ -26,6 +26,9 @@ SearchType, ) from neo4j_genai.neo4j_queries import get_search_query +import logging + +logger = logging.getLogger(__name__) class VectorRetriever(Retriever): @@ -92,6 +95,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: @@ -178,5 +184,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