Skip to content

Commit f6a6971

Browse files
authored
Update agent-evaluate-sdk.md
1 parent dbc5cce commit f6a6971

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

articles/ai-foundry/how-to/develop/agent-evaluate-sdk.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,32 +73,33 @@ import os
7373
from azure.ai.evaluation import AzureOpenAIModelConfiguration
7474
from azure.identity import DefaultAzureCredential
7575
from azure.ai.evaluation import IntentResolutionEvaluator, ResponseCompletenessEvaluator
76-
77-
76+
77+
7878
model_config = AzureOpenAIModelConfiguration(
7979
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
8080
api_key=os.environ["AZURE_OPENAI_API_KEY"],
8181
api_version=os.environ["AZURE_OPENAI_API_VERSION"],
8282
azure_deployment=os.environ["MODEL_DEPLOYMENT_NAME"],
8383
)
84-
84+
8585
intent_resolution_evaluator = IntentResolutionEvaluator(model_config)
86-
completeness_evaluator = CompletenessEvaluator(model_config=model_config)
87-
86+
response_completeness_evaluator = ResponseCompletenessEvaluator(model_config=model_config)
87+
8888
# Evaluating query and response as strings
8989
# A positive example. Intent is identified and understood and the response correctly resolves user intent
9090
result = intent_resolution_evaluator(
9191
query="What are the opening hours of the Eiffel Tower?",
9292
response="Opening hours of the Eiffel Tower are 9:00 AM to 11:00 PM.",
9393
)
9494
print(result)
95-
95+
9696
# A negative example. Only half of the statements in the response were complete according to the ground truth
97-
result = completeness_evaluator(
97+
result = response_completeness_evaluator(
9898
response="Itinery: Day 1 take a train to visit Disneyland outside of the city; Day 2 rests in hotel.",
9999
ground_truth="Itinery: Day 1 take a train to visit the downtown area for city sightseeing; Day 2 rests in hotel."
100100
)
101101
print(result)
102+
```
102103

103104
```
104105

0 commit comments

Comments
 (0)