Skip to content

Commit 9e3b0e9

Browse files
authored
Placeholder Ids for evaluators (Azure#38330)
* Placeholer Ids for evaluators * Adding id field * Adding experimental decorator * Trying out doc string * Updating evaluator ids * Fxing tests * Removing unused imports * Removing unused imports * Deleting unused code * Fixing formatting issues
1 parent 03ad432 commit 9e3b0e9

File tree

28 files changed

+154
-2
lines changed

28 files changed

+154
-2
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_bleu/_bleu.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class BleuScoreEvaluator:
4747
:caption: Initialize and call an BleuScoreEvaluator.
4848
"""
4949

50+
id = "bleu"
51+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
52+
5053
def __init__(self):
5154
self._async_evaluator = _AsyncBleuScoreEvaluator()
5255

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_coherence/_coherence.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class CoherenceEvaluator(PromptyEvaluatorBase[Union[str, float]]):
4141
_PROMPTY_FILE = "coherence.prompty"
4242
_RESULT_KEY = "coherence"
4343

44+
id = "coherence"
45+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
46+
4447
@override
4548
def __init__(self, model_config):
4649
current_dir = os.path.dirname(__file__)

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_content_safety.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from promptflow.tracing import ThreadPoolExecutorWithContext as ThreadPoolExecutor
88
from typing_extensions import overload, override
99

10-
from azure.ai.evaluation._common._experimental import experimental
1110
from azure.ai.evaluation._evaluators._common import EvaluatorBase
1211
from azure.ai.evaluation._model_configurations import Conversation
12+
from azure.ai.evaluation._common._experimental import experimental
1313

1414
from ._hate_unfairness import HateUnfairnessEvaluator
1515
from ._self_harm import SelfHarmEvaluator
@@ -41,6 +41,9 @@ class ContentSafetyEvaluator(EvaluatorBase[Union[str, float]]):
4141
:caption: Initialize and call a ContentSafetyEvaluator.
4242
"""
4343

44+
id = "content_safety"
45+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
46+
4447
# TODO address 3579092 to re-enabled parallel evals.
4548
def __init__(self, credential, azure_ai_project, **kwargs):
4649
super().__init__()

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_hate_unfairness.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class HateUnfairnessEvaluator(RaiServiceEvaluatorBase[Union[str, float]]):
5858
:caption: Initialize and call a HateUnfairnessEvaluator.
5959
"""
6060

61+
id = "hate_unfairness"
62+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
63+
6164
@override
6265
def __init__(
6366
self,

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_self_harm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class SelfHarmEvaluator(RaiServiceEvaluatorBase[Union[str, float]]):
5252
:caption: Initialize and call a SelfHarmEvaluator.
5353
"""
5454

55+
id = "self_harm"
56+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
57+
5558
@override
5659
def __init__(
5760
self,

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_sexual.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class SexualEvaluator(RaiServiceEvaluatorBase[Union[str, float]]):
5454
:caption: Initialize and call a SexualEvaluator.
5555
"""
5656

57+
id = "sexual"
58+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
59+
5760
@override
5861
def __init__(
5962
self,

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_violence.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class ViolenceEvaluator(RaiServiceEvaluatorBase[Union[str, float]]):
5454
:caption: Initialize and call a ViolenceEvaluator.
5555
"""
5656

57+
id = "violence"
58+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
59+
5760
@override
5861
def __init__(
5962
self,

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_eci/_eci.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class ECIEvaluator(RaiServiceEvaluatorBase):
5050
}
5151
"""
5252

53+
id = "eci"
54+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
55+
5356
@override
5457
def __init__(
5558
self,

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_f1_score/_f1_score.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class F1ScoreEvaluator:
131131
:caption: Initialize and call an F1ScoreEvaluator.
132132
"""
133133

134+
id = "f1_score"
135+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
136+
134137
def __init__(self):
135138
self._async_evaluator = _AsyncF1ScoreEvaluator()
136139

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_fluency/_fluency.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class FluencyEvaluator(PromptyEvaluatorBase[Union[str, float]]):
4343
_PROMPTY_FILE = "fluency.prompty"
4444
_RESULT_KEY = "fluency"
4545

46+
id = "fluency"
47+
"""Evaluator identifier, experimental and to be used only with evaluation in cloud."""
48+
4649
@override
4750
def __init__(self, model_config):
4851
current_dir = os.path.dirname(__file__)

0 commit comments

Comments
 (0)