Skip to content

Commit 920c46c

Browse files
committed
Fix
1 parent 368bdf4 commit 920c46c

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_multimodal/_content_safety_multimodal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from azure.ai.evaluation._common.math import list_mean_nan_safe
1313
from azure.ai.evaluation._exceptions import ErrorBlame, ErrorCategory, ErrorTarget, EvaluationException
14+
1415
try:
1516
from ._hate_unfairness import HateUnfairnessMultimodalEvaluator
1617
from ._self_harm import SelfHarmMultimodalEvaluator

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def __init__(self, azure_ai_project: dict, credential=None):
1919
azure_ai_project=azure_ai_project,
2020
credential=credential,
2121
)
22+
2223
async def __call__(self, *, messages: List[Dict], **kwargs):
2324
return await super().__call__(messages=messages, **kwargs)
2425

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ class SexualMultimodalEvaluator:
4242
"sexual_reason": "Some reason"
4343
}
4444
"""
45+
4546
def __init__(self, azure_ai_project: dict, credential=None):
4647
self._async_evaluator = _AsyncSexualMultimodalEvaluator(azure_ai_project, credential)
48+
4749
def __call__(self, *, messages: List[Dict], **kwargs):
4850
"""
4951
Evaluates sexual content.
@@ -55,5 +57,6 @@ def __call__(self, *, messages: List[Dict], **kwargs):
5557
:rtype: dict
5658
"""
5759
return async_run_allowing_running_loop(self._async_evaluator, messages=messages, **kwargs)
60+
5861
def _to_async(self):
5962
return self._async_evaluator

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ async def __call__(self, *, messages: List[Dict], **kwargs):
2020
class ViolenceMultimodalEvaluator:
2121
"""
2222
Initialize a violence evaluator for violence score.
23+
2324
:param azure_ai_project: The scope of the Azure AI project.
2425
It contains subscription id, resource group, and project name.
2526
:type azure_ai_project: ~azure.ai.evaluation.AzureAIProject
2627
:param credential: The credential for connecting to Azure AI project.
2728
:type credential: ~azure.core.credentials.TokenCredential
29+
2830
**Usage**
31+
2932
.. code-block:: python
3033
azure_ai_project = {
3134
"subscription_id": "<subscription_id>",
@@ -34,16 +37,20 @@ class ViolenceMultimodalEvaluator:
3437
}
3538
eval_fn = ViolenceEvaluator(azure_ai_project)
3639
result = eval_fn(query="What is the capital of France?", response="Paris.")
40+
3741
**Output format**
42+
3843
.. code-block:: python
3944
{
4045
"violence": "High",
4146
"violence_score": 6.5,
4247
"violence_reason": "Some reason"
4348
}
4449
"""
50+
4551
def __init__(self, azure_ai_project: dict, credential=None):
4652
self._async_evaluator = _AsyncViolenceMultimodalEvaluator(azure_ai_project, credential)
53+
4754
def __call__(self, *, messages: List[Dict], **kwargs):
4855
"""
4956
Evaluates violence content.
@@ -55,5 +62,6 @@ def __call__(self, *, messages: List[Dict], **kwargs):
5562
:rtype: dict
5663
"""
5764
return async_run_allowing_running_loop(self._async_evaluator, messages=messages, **kwargs)
65+
5866
def _to_async(self):
5967
return self._async_evaluator

0 commit comments

Comments
 (0)