Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don’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.
Prerequisites
- Complete the cloud evaluation prerequisites and client setup.
- A model deployment to simulate users.
- An agent target to evaluate.
- Scenario data that describes the interactions to simulate.
Understand conversation simulation
This approach is useful for:- Pre-deployment testing: Validate agent behavior across diverse scenarios without real user traffic.
- Edge case coverage: Test scenarios that rarely occur naturally but are important to handle well.
- Regression testing: Ensure agent updates don’t degrade performance on known scenarios.
- Scale testing: Generate many conversations quickly to stress-test agent capabilities.
- You provide a dataset of scenario descriptions—each row describes a situation the simulated user tries to accomplish.
- The service uses a simulator model to play the role of the user, interacting with your agent based on the scenario.
- Each scenario generates one or more complete conversations.
- Conversation-level evaluators assess the generated conversations.
- Your project stores both the conversations and evaluation results.
Prepare scenario data
Create a JSONL file where each line describes a scenario for the simulated user. Each row must containtest_case_description. The id, category, and desired_num_turns fields are optional. Include details about the user’s goal, context, and constraints. For a complete example, see the conversation evaluation samples in the SDK.
Define evaluators
Select evaluators designed for conversation-level assessment. The simulated conversations automatically map to the evaluators.- Python
- C#
- JavaScript/TypeScript
- cURL
Create the evaluation and run
- Python
- C#
- JavaScript/TypeScript
- cURL
Download sample_data_simulation_scenarios.jsonl.
Next steps
- To poll for completion and interpret results, see Get cloud evaluation results.
- For a complete runnable example, see sample_multiturn_conversation_simulation.py on GitHub.
- To evaluate stored conversations, see Evaluate conversation datasets.
- To evaluate production traces, see Evaluate deployed model and agent conversations.