Skip to main content
Items marked preview in this article are currently in preview. This preview is provided without a service-level agreement, and Microsoft doesn’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Generate individual test queries, send them to a model or agent target, and evaluate the target responses.

Prerequisites

The examples use the SDK client configured in Set up the SDK client.

Generate synthetic queries

Use the azure_ai_synthetic_data_gen_preview data source type to generate synthetic test queries, send them to a deployed model or Foundry agent, and evaluate the responses. Use this scenario when you don’t have a test dataset. The service generates queries based on a prompt you provide (and/or from the agent’s instructions), runs them against your target, and evaluates the responses.
Before you begin, complete client setup.

How synthetic data evaluation works

  1. The service generates synthetic queries based on your prompt and optional seed data files.
  2. Each query is sent to the specified target (model or agent) to generate a response.
  3. Evaluators score each response using the generated query and response.
  4. The generated queries are stored as a dataset in your project for reuse.

Parameters

Set up evaluators and data mappings

For target evaluations, map every required evaluator input explicitly. In this synthetic-data example, generated queries are available as {{item.query}}, and target responses are available as {{sample.output_text}}.

Create evaluation and run

Model target

Generate synthetic queries and evaluate a model:
You can optionally add a system prompt to shape the target model’s behavior. When you use input_messages with synthetic data generation, include only system role messages - the service provides the generated queries as user messages automatically.

Agent target

Generate synthetic queries and evaluate a Foundry agent:

Next steps