From 0ccbe020e6049584595f4fe4954dfe6a8d760eb4 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 15:29:43 -0700 Subject: [PATCH 1/8] Depending on validator as a pip dependency --- pyproject.toml | 1 + validator/post-install.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 validator/post-install.py diff --git a/pyproject.toml b/pyproject.toml index 0d1552c..c87895d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,7 @@ readme = "README.md" requires-python = ">= 3.8.1" dependencies = [ "guardrails-ai>=0.4.0", + "guardrails-grhub-response_evaluator" ] [project.optional-dependencies] diff --git a/validator/post-install.py b/validator/post-install.py deleted file mode 100644 index f4806bd..0000000 --- a/validator/post-install.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -# Install the ResponseEvaluator from the hub -os.system("guardrails hub install hub://guardrails/response_evaluator") From 57d4d7f55a42cabf141107faf883dbff1a026455 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 15:37:58 -0700 Subject: [PATCH 2/8] added back post install not to break installs immediately --- validator/post-install.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 validator/post-install.py diff --git a/validator/post-install.py b/validator/post-install.py new file mode 100644 index 0000000..f4806bd --- /dev/null +++ b/validator/post-install.py @@ -0,0 +1,4 @@ +import os + +# Install the ResponseEvaluator from the hub +os.system("guardrails hub install hub://guardrails/response_evaluator") From 29ec9369451683084bbdf05d5d770d8fb4922355 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 15:39:29 -0700 Subject: [PATCH 3/8] Revert "added back post install not to break installs immediately" This reverts commit 57d4d7f55a42cabf141107faf883dbff1a026455. --- validator/post-install.py | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 validator/post-install.py diff --git a/validator/post-install.py b/validator/post-install.py deleted file mode 100644 index f4806bd..0000000 --- a/validator/post-install.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -# Install the ResponseEvaluator from the hub -os.system("guardrails hub install hub://guardrails/response_evaluator") From 56d6f3de2f300cee965dadbed72bb7adf4b22475 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 15:41:51 -0700 Subject: [PATCH 4/8] bumped version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c87895d..f975b8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "qa_relevance_llm_eval" -version = "0.0.0" +version = "0.0.1" description = "Validates that an answer is relevant to the question asked by asking the LLM to self evaluate." authors = [ {name = "Guardrails AI", email = "contact@guardrailsai.com"} From a64a2ad281fd5b182d7479f3a452f6370388394e Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 19:47:01 -0700 Subject: [PATCH 5/8] Added Shared CI action --- .github/publish_pypi.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/publish_pypi.yml diff --git a/.github/publish_pypi.yml b/.github/publish_pypi.yml new file mode 100644 index 0000000..0c0ca83 --- /dev/null +++ b/.github/publish_pypi.yml @@ -0,0 +1,15 @@ +name: Publish to Guardrails Hub + +on: + workflow_dispatch: + pull_request: + +jobs: + setup: + runs-on: ubuntu-latest + steps: + - name: Build & Deploy + uses: guardrails-ai/guardrails/.github/actions/validator_pypi_publish@main + with: + guardrails_token: ${{ secrets.GR_GUARDRAILS_TOKEN }} + validator_id: guardrails/qa_relevance_llm_eval \ No newline at end of file From 6876fee4c14cb517af96c5da64ec2c158ce8d404 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 23 Oct 2024 20:19:21 -0700 Subject: [PATCH 6/8] moved workflow --- .github/{ => workflows}/publish_pypi.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/publish_pypi.yml (100%) diff --git a/.github/publish_pypi.yml b/.github/workflows/publish_pypi.yml similarity index 100% rename from .github/publish_pypi.yml rename to .github/workflows/publish_pypi.yml From 9ca30bd98e5f20ad45c04a92734f5f0d149f00b3 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 30 Oct 2024 10:36:49 -0700 Subject: [PATCH 7/8] added back post install --- validator/post-install.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 validator/post-install.py diff --git a/validator/post-install.py b/validator/post-install.py new file mode 100644 index 0000000..f4806bd --- /dev/null +++ b/validator/post-install.py @@ -0,0 +1,4 @@ +import os + +# Install the ResponseEvaluator from the hub +os.system("guardrails hub install hub://guardrails/response_evaluator") From bdd8c035a7935b4d3d4457488f54494b5b2b4990 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Wed, 30 Oct 2024 10:44:07 -0700 Subject: [PATCH 8/8] updated workflow --- .github/workflows/publish_pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 0c0ca83..282301f 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -2,7 +2,9 @@ name: Publish to Guardrails Hub on: workflow_dispatch: - pull_request: + push: + branches: + - main jobs: setup: