from azure.ai.evaluation import (
F1ScoreEvaluator,
RougeScoreEvaluator,
BleuScoreEvaluator,
GleuScoreEvaluator,
MeteorScoreEvaluator
)
f1 = F1ScoreEvaluator()
rouge = RougeScoreEvaluator()
bleu = BleuScoreEvaluator()
Safety Evaluators
python
from azure.ai.evaluation import (
ViolenceEvaluator,
SexualEvaluator,
SelfHarmEvaluator,
HateUnfairnessEvaluator,
IndirectAttackEvaluator,
ProtectedMaterialEvaluator
)
violence = ViolenceEvaluator(azure_ai_project=project_scope)
sexual = SexualEvaluator(azure_ai_project=project_scope)
Single Row Evaluation
python
from azure.ai.evaluation import GroundednessEvaluator
groundedness = GroundednessEvaluator(model_config)
result = groundedness(
query="What is Azure AI?",
context="Azure AI is Microsoft's AI platform...",
response="Azure AI provides AI services and tools."
)
print(f"Groundedness score: {result['groundedness']}")
print(f"Reason: {result['groundedness_reason']}")
from azure.ai.evaluation import QAEvaluator, ContentSafetyEvaluator
# All quality metrics in one
qa_evaluator = QAEvaluator(model_config)
# All safety metrics in one
safety_evaluator = ContentSafetyEvaluator(azure_ai_project=project_scope)
result = evaluate(
data="data.jsonl",
evaluators={
"qa": qa_evaluator,
"content_safety": safety_evaluator
}
)
Evaluate Application Target
python
from azure.ai.evaluation import evaluate
from my_app import chat_app # Your application
result = evaluate(
data="queries.jsonl",
target=chat_app, # Callable that takes query, returns response
evaluators={
"groundedness": groundedness
},
evaluator_config={
"default": {
"column_mapping": {
"query": "${data.query}",
"context": "${outputs.context}",
"response": "${outputs.response}"
}
}
}
)
Custom Evaluators
Code-Based
python
from azure.ai.evaluation import evaluator
@evaluator
def word_count_evaluator(response: str) -> dict:
return {"word_count": len(response.split())}
# Use in evaluate()
result = evaluate(
data="data.jsonl",
evaluators={"word_count": word_count_evaluator}
)
Prompt-Based
python
from azure.ai.evaluation import PromptChatTarget
class CustomEvaluator:
def __init__(self, model_config):
self.model = PromptChatTarget(model_config)
def __call__(self, query: str, response: str) -> dict:
prompt = f"Rate this response 1-5: Query: {query}, Response: {response}"
result = self.model.send_prompt(prompt)
return {"custom_score": int(result)}
Log to Foundry Project
python
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
project = AIProjectClient.from_connection_string(
conn_str=os.environ["AIPROJECT_CONNECTION_STRING"],
credential=DefaultAzureCredential()
)
result = evaluate(
data="data.jsonl",
evaluators={"groundedness": groundedness},
azure_ai_project=project.scope # Logs results to Foundry
)
print(f"View results: {result['studio_url']}")
Evaluator Reference
Evaluator
Type
Metrics
GroundednessEvaluator
AI
groundedness (1-5)
RelevanceEvaluator
AI
relevance (1-5)
CoherenceEvaluator
AI
coherence (1-5)
FluencyEvaluator
AI
fluency (1-5)
SimilarityEvaluator
AI
similarity (1-5)
RetrievalEvaluator
AI
retrieval (1-5)
F1ScoreEvaluator
NLP
f1_score (0-1)
RougeScoreEvaluator
NLP
rouge scores
ViolenceEvaluator
Safety
violence (0-7)
SexualEvaluator
Safety
sexual (0-7)
SelfHarmEvaluator
Safety
self_harm (0-7)
HateUnfairnessEvaluator
Safety
hate_unfairness (0-7)
QAEvaluator
Composite
All quality metrics
ContentSafetyEvaluator
Composite
All safety metrics
Best Practices
Use composite evaluators for comprehensive assessment
Map columns correctly — mismatched columns cause silent failures
Log to Foundry for tracking and comparison across runs
Create custom evaluators for domain-specific metrics
Use NLP evaluators when you have ground truth answers
Safety evaluators require Azure AI project scope
Batch evaluation is more efficient than single-row loops
Limited provenance information — review the source before installing.
Freshness11/15
Updated within the last 6 months.
Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.
Proud of your score? Add this badge to your README.
Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.
Score badge
Markdown
[](https://www.remoteopenclaw.com/skills/thegovind/azure-ai-evaluation-py)
HTML
<a href="https://www.remoteopenclaw.com/skills/thegovind/azure-ai-evaluation-py"><img src="https://www.remoteopenclaw.com/skills/thegovind/azure-ai-evaluation-py/badges/score.svg" alt="Azure AI Evaluation Py skill"/></a>
Azure AI Evaluation Py FAQ
How do I install the Azure AI Evaluation Py skill?
Run “clawhub install thegovind/azure-ai-evaluation-py” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.
What does the Azure AI Evaluation Py skill do?
Assess generative AI application performance with built-in and custom evaluators. The SKILL.md section on this page shows the exact instructions the skill gives your agent.
Is the Azure AI Evaluation Py skill free?
Yes. Azure AI Evaluation Py is a free, open-source skill by thegovind. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.
Does Azure AI Evaluation Py work with Claude Code and OpenClaw?
Yes. Skills use the portable SKILL.md format, so Azure AI Evaluation Py works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.