Prerequisites
- Complete the cloud evaluation prerequisites and client setup.
- A JSONL or CSV dataset of input queries.
- A deployed model, prompt agent, or hosted agent to use as the target.
Evaluate a model target
Send queries to a deployed model at runtime. Evaluate the responses by using theazure_ai_target_completions data source type with an azure_ai_model target. Your input data contains queries. The model generates responses, which you then evaluate.
Before you begin, complete client setup and Prepare input data.
You can use the model router as the target model. Model router is supported only as the evaluation target. It can’t be selected as a model for any other evaluation feature.
Define the message template and target
Theinput_messages template controls how queries are sent to the model. Use {{item.query}} to reference fields from your input data. Specify the model to evaluate and optional sampling parameters:
Set up evaluators and data mappings
When the model generates responses at runtime, use{{sample.output_text}} in data_mapping to reference the model’s output. Use {{item.field}} to reference fields from your input data.
Create evaluation and run
Evaluate an agent target
Send queries to a Foundry agent at runtime and evaluate the responses by using theazure_ai_target_completions data source type with an azure_ai_agent target. This scenario works for both prompt agents and hosted agents.
Before you begin, complete client setup and Prepare input data.
Define the message template and target
Theinput_messages template controls how queries are sent to the agent. Use {{item.query}} to reference fields from your input data. Specify the agent to evaluate by name:
Set up evaluators and data mappings
When the agent generates responses at runtime, use{{sample.*}} variables in data_mapping to reference the agent’s output:
Create evaluation and run
Hosted agent invocations protocol
Hosted agents that use the invocations protocol support the sameazure_ai_agent target type but use a freeform input_messages format. Instead of the structured template format, provide a JSON object that maps directly to the agent’s /invocations request body. Use {{item.*}} placeholders to substitute fields from your input data.
If a hosted agent supports both the responses and invocations protocols, the service defaults to using the invocations protocol.
Define the message format and target
Create evaluation and run
{{sample.output_text}} for the agent’s text response and {{sample.output_items}} for the full structured output including tool calls.