一键导入
add-evaluation
Create or update evaluation scenarios for the tests/evaluation framework, including session-based scenarios and A/B comparisons
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update evaluation scenarios for the tests/evaluation framework, including session-based scenarios and A/B comparisons
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Read-only — assemble the wider runtime picture of a deployed voice app from azd deployment artifacts and Azure Monitor (Application Insights / Log Analytics) via Azure MCP or az CLI, then render it as KQL, call timelines, latency waterfalls, and mermaid diagrams
Service catalog and guided onboarding for the azd deployment. USE WHEN the user wants to discover, install, set up, or be walked through the deployable components (Azure OpenAI/AI Foundry, Speech, ACS/telephony, Cosmos DB, Redis, Container Apps, Key Vault, App Config, CardAPI MCP), asks "what gets deployed", "what services does this use", "help me onboard", "set up the deployment", "guide me through azd up", "which components do I need", or wants to enable optional pieces (phone number, EasyAuth, data seeding). Acts as the entry point an agent hooks into to assess current state, present the catalog, and onboard each component. DO NOT USE FOR: deep azd hook/flow internals or model-availability checks (use deployment-guide); runtime failure diagnosis (use troubleshoot); telemetry/log analysis (use observability-insights).
Agent-first, read-only diagnosis of the voice pipeline (deploy, telephony, STT, LLM, TTS, state) — gather evidence via Azure MCP / azd artifacts / CLI, probe the user for missing details, and recommend fixes without changing anything
Require relevant tests and documentation updates for any code or config change, and report what was run.
Guide azd-based deployments, including where azure.yaml and azd hook scripts live, the current deployment flow, troubleshooting docs, and regional/model availability checks for Azure OpenAI
Add a new React component with Material UI
| name | add-evaluation |
| description | Create or update evaluation scenarios for the tests/evaluation framework, including session-based scenarios and A/B comparisons |
Create evaluation scenarios in tests/evaluation/scenarios/.
| Type | Location | Purpose |
|---|---|---|
| Session-based | session_based/ | Multi-agent sessions and handoffs |
| A/B Comparison | ab_tests/ | Compare model variants |
# tests/evaluation/scenarios/session_based/{scenario_name}.yaml
scenario_name: banking_multi_agent
description: "Session-based multi-agent evaluation"
# Optional: Create demo user for realistic tool responses
demo_user:
full_name: "Sarah Johnson"
email: "sarah.johnson@example.com"
phone_number: "+18885551234"
scenario: banking # or "insurance"
seed: 42 # Fixed seed for reproducible data
persist: false # Don't persist to database
session_config:
agents: [BankingConcierge, CardRecommendation]
start_agent: BankingConcierge
handoff_type: announced
turns:
- turn_id: turn_1
user_input: "I'd like to check my account"
expectations:
tools_called:
- verify_client_identity
The demo_user section creates a realistic user profile before running the scenario.
This ensures tools like get_user_profile, verify_client_identity, and lookup_decline_code
have actual data to return.
demo_user:
full_name: "Sarah Johnson" # Required: User's name
email: "sarah@example.com" # Required: User's email
phone_number: "+18885551234" # Optional: E.164 format
scenario: banking # "banking" or "insurance"
seed: 42 # Optional: For reproducible data
persist: false # Whether to save to database
# Insurance-only options:
insurance_role: policyholder # "policyholder" or "cc_rep"
insurance_company_name: "..." # If cc_rep
test_scenario: golden_path # Predefined test scenarios
Banking demo user includes:
Insurance demo user includes:
# tests/evaluation/scenarios/ab_tests/{comparison_name}.yaml
comparison_name: fraud_model_comparison
scenario_template: banking
description: "Compare model variants for banking scenario"
variants:
- variant_id: baseline
agent_overrides:
- agent: BankingConcierge
model_override:
deployment_id: gpt-4o
temperature: 0.6
- variant_id: experimental
agent_overrides:
- agent: BankingConcierge
model_override:
deployment_id: gpt-5.1
reasoning_effort: medium
turns:
- turn_id: turn_1
user_input: "Test message"
expectations:
tools_called:
- expected_tool
comparison_metrics:
- tool_precision
- latency_p95_ms
- cost_per_turn
# Via Makefile (recommended)
make eval-run SCENARIO=tests/evaluation/scenarios/session_based/my_scenario.yaml
# Or interactive CLI
make eval
# Submit to Azure AI Foundry (optional)
python -m tests.evaluation.cli submit \
--data runs/my_run/foundry_eval.jsonl \
--endpoint "$AZURE_AI_FOUNDRY_PROJECT_ENDPOINT"
expectations:
tools_called: [tool1, tool2] # Required tools
tools_optional: [tool3] # Won't fail if missing
tools_forbidden: [tool4] # Must NOT be called
handoff:
to_agent: TargetAgent # Expected handoff
no_handoff: false # Assert no handoff occurs
response_constraints:
max_tokens: 150
must_include: ["keyword"]
must_not_include: ["forbidden"]
must_ask_for: ["missing info"]
max_latency_ms: 5000
Export evaluation results to Azure AI Foundry format for cloud-based evaluation:
# Add to any scenario or comparison YAML
foundry_export:
enabled: true
output_filename: foundry_eval.jsonl
include_metadata: true
context_source: evidence # 'evidence' | 'raw_tool_results' | 'none'
evaluators:
# AI-based quality evaluators (require model deployment)
- id: builtin.relevance
init_params:
deployment_name: gpt-4o
data_mapping:
query: "${data.query}"
response: "${data.response}"
context: "${data.context}"
- id: builtin.coherence
init_params:
deployment_name: gpt-4o
- id: builtin.groundedness
init_params:
deployment_name: gpt-4o
# Safety evaluators (no model required)
- id: builtin.violence
- id: builtin.self_harm
- id: builtin.hate_unfairness
# NLP metrics (no model required)
- id: builtin.f1_score
- id: builtin.bleu_score
| Category | Evaluator ID | Requires Model |
|---|---|---|
| Quality | builtin.relevance | Yes |
| Quality | builtin.coherence | Yes |
| Quality | builtin.fluency | Yes |
| Quality | builtin.groundedness | Yes |
| Quality | builtin.similarity | Yes |
| Safety | builtin.violence | No |
| Safety | builtin.sexual | No |
| Safety | builtin.self_harm | No |
| Safety | builtin.hate_unfairness | No |
| NLP | builtin.f1_score | No |
| NLP | builtin.bleu_score | No |
| NLP | builtin.rouge_score | No |
When foundry_export.enabled: true, these files are added to the run output:
foundry_eval.jsonl - Dataset for Foundry uploadfoundry_evaluators.json - Evaluator configuration (if evaluators specified)from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
client = AIProjectClient.from_connection_string(
credential=DefaultAzureCredential(),
conn_str="<connection_string>"
)
# Upload dataset
dataset = client.datasets.upload_file(
file_path="runs/my_scenario/foundry_eval.jsonl",
name="my_evaluation_data"
)
# Run evaluation with configured evaluators
import json
with open("runs/my_scenario/foundry_evaluators.json") as f:
evaluator_config = json.load(f)
# Use with Evaluation API...