windlass.providers.evaluation.external¶
external
¶
RAGAS and DeepEval adapters.
Both are established evaluation frameworks with metric implementations that have been validated against human judgement. Windlass wraps them so you can run their metrics on Windlass samples without learning their data models.
Install with::
pip install "windlass[evaluation]"
Example
from windlass import Windlass # doctest: +SKIP ev = Windlass.evaluator("ragas", metrics=["faithfulness"], # doctest: +SKIP ... llm=Windlass.llm("openai")) # doctest: +SKIP ev.evaluate(answers) # doctest: +SKIP
RagasEvaluator
¶
RagasEvaluator(
*,
metrics: Sequence[str] | None = None,
threshold: float = 0.5,
llm: Any = None,
embeddings: Any = None,
**config: Any
)
Bases: Evaluator
Evaluation via the RAGAS framework.
RAGAS specialises in reference-free RAG evaluation — it scores faithfulness and context quality without needing ground-truth answers, which is what makes it usable on production traffic rather than only on a curated test set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics
|
Sequence[str] | None
|
RAGAS metric names — |
None
|
threshold
|
float
|
Score at or above which a result passes. |
0.5
|
llm
|
Any
|
Judge model. RAGAS needs a LangChain-compatible model; a Windlass
LLM whose |
None
|
embeddings
|
Any
|
Embedding model for similarity-based metrics. |
None
|
**config
|
Any
|
Forwarded to :class: |
{}
|
Raises:
| Type | Description |
|---|---|
MissingDependencyError
|
When |
EvaluationError
|
When a metric name is unknown or the run fails. |
Note
RAGAS evaluates a whole dataset at once, so this adapter overrides
:meth:aevaluate rather than scoring sample by sample.
Source code in src\windlass\providers\evaluation\external.py
default_metrics
classmethod
¶
available_metrics
classmethod
¶
Return every RAGAS metric this adapter can resolve.
Source code in src\windlass\providers\evaluation\external.py
native
¶
aevaluate_sample
async
¶
Evaluate a single sample by running the dataset path with one row.
aevaluate
async
¶
Run RAGAS over the whole dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samples
|
Sequence[EvalSample | Any]
|
Samples, RAG answers, or dicts. |
required |
Returns:
| Type | Description |
|---|---|
EvaluationReport
|
The aggregated report. |
Raises:
| Type | Description |
|---|---|
EvaluationError
|
When RAGAS fails or produces no scores. |
Source code in src\windlass\providers\evaluation\external.py
DeepEvalEvaluator
¶
DeepEvalEvaluator(
*,
metrics: Sequence[str] | None = None,
threshold: float = 0.5,
llm: Any = None,
**config: Any
)
Bases: Evaluator
Evaluation via the DeepEval framework.
DeepEval's angle is unit-test-style evaluation: metrics carry thresholds and produce pass/fail verdicts with explanations, which fits naturally into CI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics
|
Sequence[str] | None
|
DeepEval metric names — |
None
|
threshold
|
float
|
Threshold passed to each metric. |
0.5
|
llm
|
Any
|
Judge model. DeepEval accepts a model name string or its own
|
None
|
**config
|
Any
|
Forwarded to :class: |
{}
|
Raises:
| Type | Description |
|---|---|
MissingDependencyError
|
When |
EvaluationError
|
When a metric name is unknown. |
Source code in src\windlass\providers\evaluation\external.py
default_metrics
classmethod
¶
available_metrics
classmethod
¶
native
¶
aevaluate_sample
async
¶
Score one sample with every configured DeepEval metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
EvalSample
|
The interaction to score. |
required |
Returns:
| Type | Description |
|---|---|
list[EvaluationResult]
|
One result per metric, carrying DeepEval's own explanation. |
Raises:
| Type | Description |
|---|---|
EvaluationError
|
When DeepEval fails to construct or run a metric. |