Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ It can be used in a RAG system to prevent the model from hallucinating or genera
In this example we apply the RagContextValidator to validate the relevance of the retrieved context to the user's query.

```python
from validator.prompts.prompts import RagContextRelevancePrompt
from validator.main import MLcubeRagContextValidator
from guardrails import Guard

# Define the guard with the MLcubeRagContextValidator,
# specifying the relevance prompt generator to enable
Expand Down Expand Up @@ -88,11 +85,6 @@ In this example we evaluate the usefulness of the retrieved context to the user'

```python

from validator.prompts.prompts import (
RagContextRelevancePrompt,
RagContextUsefulnessPrompt,
)

guard = Guard().use(
MLcubeRagContextValidator(
rag_context_eval_prompt=RagContextUsefulnessPrompt(),
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark_llm_rag_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

sys.path.append(".")
from guardrails import Guard
from validator.prompts.prompts import (
from validator.prompts import (
Ml3RagContextEvalBasePrompt,
RagContextUsefulnessPrompt,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rag-context-evaluator"
version = "0.0.2"
version = "0.0.3"
description = "ML3 RAG Context Evaluator"
authors = [
{name = "MLcube", email = "info@mlcube.com"}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

sys.path.append(".")
from validator.prompts.prompts import RagContextUsefulnessPrompt
from validator.prompts import RagContextUsefulnessPrompt

from validator.main import MLcubeRagContextValidator

Expand Down
10 changes: 9 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
register_validator,
)
import litellm
from validator.prompts.prompts import (
from .prompts import (
Ml3RagContextEvalBasePrompt,
)
from validator.models import RagRatingResponse
from .models import RagRatingResponse
from langchain import chat_models

logger = logging.getLogger(__name__)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions validator/prompts/prompts.py → validator/prompts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from validator.enums import TextLanguage
from validator.prompts.prompt_hub import (
from .enums import TextLanguage
from .prompt_hub import (
RAG_CONTEXT_RELEVANCE_PROMPT,
RAG_CONTEXT_USEFULNESS_PROMPT,
)
Expand Down
Empty file removed validator/prompts/__init__.py
Empty file.