diff --git a/.github/workflows/pr_qc.yml b/.github/workflows/pr_qc.yml index 7a46efe..f7f4908 100644 --- a/.github/workflows/pr_qc.yml +++ b/.github/workflows/pr_qc.yml @@ -9,11 +9,16 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v7 with: + enable-cache: false python-version: 3.11 - name: Run qa + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | - pip install ".[dev]" + python -m venv ./.venv + source ./.venv/bin/activate + make dev make qa diff --git a/README.md b/README.md index d6141f2..88042a0 100644 --- a/README.md +++ b/README.md @@ -153,16 +153,18 @@ Note: **Parameters** -- **`value`** _(Any)_: The input value to validate. -- **`metadata`** _(dict)_: A dictionary containing metadata required for validation. Keys and values must match the expectations of this validator. +- **`value`** *(Any)*: The input value to validate. +- **`metadata`** *(dict)*: A dictionary containing metadata required for validation. Keys and values must match the expectations of this validator. + + | Key | Type | Description | Default | | --- | --- | --- | --- | | `user_input` | String | The original user query passed into the RAG system. | N/A (Required) | | `retrieved_context` | String | The context retrieved and used by the RAG system. | N/A (Required) | | `min_range_value` | String | The minimum value for the rating range used by the LLM judge. | 0 (the default of the validator class) | | `max_range_value` | String | The maximum value for the rating range used by the LLM judge. | 1 (the default of the validator class) | - + **Returns** -**`ValidationResult`**: Returns a `PassResult` if the LLM judge's rating meets or exceeds the pass threshold, or a `FailResult` with detailed explanation if the rating is below the threshold. \ No newline at end of file +**`ValidationResult`**: Returns a `PassResult` if the LLM judge's rating meets or exceeds the pass threshold, or a `FailResult` with detailed explanation if the rating is below the threshold. diff --git a/pyproject.toml b/pyproject.toml index ab59b90..867b1e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rag-context-evaluator" -version = "0.0.1" +version = "0.0.2" description = "ML3 RAG Context Evaluator" authors = [ {name = "MLcube", email = "info@mlcube.com"} diff --git a/uv.lock b/uv.lock index be1b535..b4ccf02 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.10, <=3.13" resolution-markers = [ "python_full_version >= '3.13'", @@ -1959,7 +1959,7 @@ wheels = [ [[package]] name = "rag-context-evaluator" -version = "0.0.1" +version = "0.0.2" source = { virtual = "." } dependencies = [ { name = "guardrails-ai" }, diff --git a/validator/main.py b/validator/main.py index 703e0a3..c3344b5 100644 --- a/validator/main.py +++ b/validator/main.py @@ -1,6 +1,4 @@ from typing import Any, Callable, Dict, Optional -from guardrails import Guard -import openai import logging from guardrails.validator_base import ( FailResult,