Skip to content

Commit 45151ca

Browse files
committed
implement changes, add coments with todo
1 parent 5fa9813 commit 45151ca

File tree

7 files changed

+31
-56
lines changed

7 files changed

+31
-56
lines changed

sdk/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ dependencies = [
3838
"markitdown[pdf,docx,pptx,xlsx]>=0.1.0",
3939
"tomli>=2.2.1",
4040
"tomli-w>=1.2.0",
41-
"deepeval>=3.0.0",
42-
"mirascope>=1.24.0",
41+
"deepeval==3.4.7",
4342
"tenacity>=8.2.3",
4443
"pyyaml>=6.0",
4544
"pydantic>=2.0.0",

sdk/src/rhesis/sdk/metrics/__init__.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55
RhesisMetricFactory,
66
RhesisPromptMetric,
77
)
8-
9-
# Lazy import to avoid circular dependencies
10-
# from .deepeval import ( # Re-export DeepEval metrics
11-
# DeepEvalMetricBase,
12-
# DeepEvalMetricFactory,
13-
# DeepEvalAnswerRelevancy,
14-
# DeepEvalFaithfulness,
15-
# DeepEvalContextualRelevancy,
16-
# DeepEvalContextualPrecision,
17-
# DeepEvalContextualRecall,
18-
# )
198
from rhesis.sdk.metrics.providers.ragas import ( # Re-export Ragas metrics
209
RagasAnswerRelevancy,
2110
RagasContextualPrecision,
@@ -52,14 +41,6 @@
5241
"RhesisMetricBase",
5342
"RhesisMetricFactory",
5443
"RhesisPromptMetric",
55-
# DeepEval metrics (commented out to avoid circular imports)
56-
# "DeepEvalMetricBase",
57-
# "DeepEvalMetricFactory",
58-
# "DeepEvalAnswerRelevancy",
59-
# "DeepEvalFaithfulness",
60-
# "DeepEvalContextualRelevancy",
61-
# "DeepEvalContextualPrecision",
62-
# "DeepEvalContextualRecall",
6344
# Ragas metrics
6445
"RagasMetricBase",
6546
"RagasMetricFactory",

sdk/src/rhesis/sdk/metrics/base.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
"""
2+
3+
TODO:
4+
These strings are spread all over the class as strings. Can we optimize this?
5+
6+
7+
# Extract all other keys as custom parameters
8+
reserved_keys = {
9+
"class_name",
10+
"backend",
11+
"threshold",
12+
"reference_score",
13+
"threshold_operator",
14+
"description",
15+
"name",
16+
}
17+
Also, the method retry_evaluationmight be better placed in a utils type of module?
18+
"""
19+
120
from abc import ABC, abstractmethod
221
from dataclasses import dataclass, field
322
from functools import wraps

sdk/src/rhesis/sdk/metrics/evaluator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# TODO - move this file to the backend
12
import concurrent.futures
23
import logging
34
from typing import Any, Dict, List, Optional, Tuple, Union

sdk/src/rhesis/sdk/metrics/providers/native/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A generic metric that evaluates outputs based on a custom prompt template. It us
1010

1111
#### Features:
1212
- Supports customizable evaluation prompts, steps, and reasoning
13-
- Uses Mirascope's structured response models for robust parsing
13+
- Uses structured response models (Pydantinc and JSON Schema) for robust parsing
1414
- Provides both raw and normalized scores
1515
- Includes detailed evaluation reasoning
1616

sdk/src/rhesis/sdk/metrics/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## TODO - move this file to the backend
12
from typing import Any, Dict, List, Optional, Union
23

34
from rhesis.sdk.metrics.base import MetricConfig

sdk/uv.lock

Lines changed: 8 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)