Skip to content

Commit 4561ed4

Browse files
committed
updated prompt based custom evaluation
1 parent 7010582 commit 4561ed4

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

sdk/ai/azure-ai-projects/samples/evaluation/sample_eval_catalog_prompt_based_evaluators.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,27 @@
5757
"name": "my_custom_evaluator_prompt",
5858
"categories": [EvaluatorCategory.QUALITY],
5959
"display_name": "my_custom_evaluator_prompt",
60-
"description": "Custom evaluator to for groundedness",
60+
"description": "Custom evaluator for groundedness",
6161
"definition": {
6262
"type": EvaluatorDefinitionType.PROMPT,
6363
"prompt_text": """
6464
You are a Groundedness Evaluator.
6565
66-
Your task is to evaluate how well the given response is grounded in the provided ground truth.
67-
Groundedness means the response’s statements are factually supported by the ground truth.
66+
Your task is to evaluate how well the given response is grounded in the provided ground truth.
67+
Groundedness means the response’s statements are factually supported by the ground truth.
6868
Evaluate factual alignment only — ignore grammar, fluency, or completeness.
6969
7070
---
7171
7272
### Input:
7373
Query:
74-
{query}
74+
{{query}}
7575
7676
Response:
77-
{response}
77+
{{response}}
7878
7979
Ground Truth:
80-
{ground_truth}
80+
{{ground_truth}}
8181
8282
---
8383
@@ -90,13 +90,16 @@
9090
9191
---
9292
93-
### Output should be Integer:
94-
<integer from 1 to 5>
93+
### Output Format (JSON):
94+
{
95+
"result": <integer from 1 to 5>,
96+
"reason": "<brief explanation for the score>"
97+
}
9598
""",
9699
"init_parameters": {
97100
"type": "object",
98101
"properties": {"deployment_name": {"type": "string"}, "threshold": {"type": "number"}},
99-
"required": ["deployment_name"],
102+
"required": ["deployment_name", "threshold"],
100103
},
101104
"data_schema": {
102105
"type": "object",
@@ -108,7 +111,7 @@
108111
"required": ["query", "response", "ground_truth"],
109112
},
110113
"metrics": {
111-
"tool_selection": {
114+
"custom_prompt": {
112115
"type": "ordinal",
113116
"desirable_direction": "increase",
114117
"min_value": 1,
@@ -147,7 +150,7 @@
147150
"response": "{{item.response}}",
148151
"ground_truth": "{{item.ground_truth}}",
149152
},
150-
"initialization_parameters": {"deployment_name": f"{model_deployment_name}", "threshold": 3.5},
153+
"initialization_parameters": {"deployment_name": f"{model_deployment_name}", "threshold": 3},
151154
}
152155
]
153156

0 commit comments

Comments
 (0)