https://retellai.com/?utm_source=discord&utm_medium=seo logo
I’m trying to use the Simulation feature to import...
# 💬・general
w
@AI Evy I’m trying to use the Simulation feature to import a batch of test cases via JSON, but I can’t find the correct schema anywhere in the docs. Every attempt gives me either: “Invalid file format: expected an array of test cases,” or “Sync failed: cannot read properties of undefined (reading 'length').” Could you please show me the exact JSON structure and required field names for importing multiple test cases at once into the Simulation dashboard? Specifically: What should the top-level structure look like (array, object, or { "test_cases": [] })? What fields are required in each test case (e.g. name, user_prompt, success_criteria, dynamic_variables, llm_model)? Can dynamic_variables or success_criteria be omitted, or are they mandatory? Is there a sample file I can download or replicate for batch import? Thank you — I’m testing this with GPT-4o agents and need to create ~15 cases at once for a gym lead reconnection agent.
a
Thanks for tagging me @webb_100. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Batch test your agent](https://docs.retellai.com/test/batch-test-simulation) [[2] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) ​
### Answer I don't have the specific JSON schema for importing batch test cases into Retell AI's Simulation feature in the available sources. The documentation covers how to set up batch testing through the interface [(1) ]() and create individual test cases [(2) ]() , but doesn't provide the exact JSON structure for bulk imports. The sources show that batch testing allows you to run multiple test cases simultaneously [(1) ]() and that individual test cases can include elements like user prompts, success criteria, and dynamic variables [(2) ]() , but the specific import format isn't documented. For the exact JSON schema and required field names for batch importing test cases, I'd recommend checking these resources: - [Batch test your agent]() - [Automatically test your agent]() Would you like me to try providing a general answer based on my knowledge of typical test case structures, or would you prefer to contact support directly for the specific import schema?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy Could you please confirm the exact JSON schema expected by the “Import Test Cases” button in the Simulation dashboard? Specifically, what are the correct property names and nesting structure for: the top-level array, and the individual test case objects (fields for user input, success criteria, variables, model, etc.)? Example: should each test object use user_prompt or input? success_criteria or expected_output? I’ve tried both { "test_cases": [] } and raw [] arrays, but I keep getting these errors: Invalid file format: expected an array of test cases Cannot read properties of undefined (reading 'length') If there’s any working sample JSON file or snippet available internally, could you please share it? I just want to verify 15 conversation scenarios for a GPT-4o agent before deployment.
a
Thanks for the follow-up, @webb_100. I'll get back to you soon.
### Answer I don't have the specific JSON schema for importing test cases via the "Import Test Cases" button in the Simulation dashboard in the available sources. The documentation covers how to create individual test cases through the interface [(1) ]() and the general testing workflow [(2) ]() , but doesn't provide the exact JSON structure or field names for bulk imports. The sources show that individual test cases can include elements like user prompts (using a specific format with Identity, Goal, and Personality sections) [(1) ]() , evaluation metrics , and optional test variables and function mocks , but the specific import format and property names aren't documented. For the exact JSON schema, property names, and required field structure for batch importing test cases, I'd recommend: - Visit [Contact Sales]() - Visit [) Would you like me to try providing a general answer based on my knowledge instead?
w
@AI Evy [ { "name": "Direct Opt-In", "prompt": { "identity": "You are a friendly AI assistant for Melbourne Fitness Studio.", "goal": "Reconnect with a lead and book a studio tour.", "personality": "Warm, conversational, supportive." }, "user_input": "Hey, I enquired about joining recently — can you book me in for a tour this week?", "evaluation_metrics": [ "Verify that the agent skips discovery and proceeds to scheduling.", "Ensure the conversation ends with a confirmed tour booking." ], "variables": { "first_name": "Ben", "full_name": "Ben Webb", "email": "benandwebb@gmail.com", "greeting": "Hi Ben, it’s Sam from Melbourne Fitness Studio, how’s your day going?" }, "model": "gpt-4o-mini" } ] Or if not, could you show me the correct field names and nesting pattern that your internal Simulation import expects?
a
Thanks for the follow-up, @webb_100. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) ​
### Answer I don't have the specific JSON schema for importing test cases via the "Import Test Cases" button in the available sources. The documentation shows how to create individual test cases through the interface [(1) ]() , but doesn't provide the exact JSON structure or field names for bulk imports. From the available documentation, I can see that individual test cases include user prompts using a specific format :
Copy code
///## Identity
Your name is Mike.
Your date of birth is June 10, 1999.
Your order number is 7891273.
///## Goal
Your primary objective is to return the package you received and get a refund.
///## Personality
You are a patient customer. However, if the conversation becomes too long or complicated, you will show signs of impatience. If the issue remains unresolved, you may become frustrated and angry.
The documentation also shows that evaluation metrics can be defined in this format :
Copy code
1. Verify that the customer successfully returned the package and received a refund.
2. Confirm that the end_call function was called at the end of the conversation.
3. Ensure the agent's responses are conversational and contain 5 sentences or fewer.
Additionally, test variables and function mocks can be configured as optional components . However, the specific JSON schema for bulk imports, including the correct property names and nesting structure, isn't documented in the available sources. For the exact JSON schema and field names required by the Import Test Cases functionality, I'd recommend: - Visit [Contact Sales]() - Visit [) Would you like me to try providing a general answer based on my knowledge instead?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
yes provide a general answer
@AI Evy yes provide a general answer
a
Thanks for the follow-up, @webb_100. I'll get back to you soon.
**Key field name possibilities**: -
user_prompt
(instead of nested prompt object) -
success_criteria
or
evaluation_metrics
-
dynamic_variables
or
variables
-
llm_model
or
model
The "cannot read properties of undefined" error suggests the import function is looking for specific field names that might differ from what you're using. Since the exact schema isn't documented, you might need to experiment with these variations or contact Retell AI support for the definitive import format.
### Answer Based on the available Retell AI documentation, I don't have the specific JSON schema for the "Import Test Cases" feature. However, I can provide a general answer based on common testing frameworks and the structure shown in Retell AI's interface. Based on typical test case import patterns and the documented format for individual test cases in Retell AI, your JSON structure looks reasonable but may need some adjustments. Here's what I'd suggest trying: **Top-level structure**: Use a plain array
[]
rather than wrapping in an object, as the error suggests it expects "an array of test cases." **User prompt format**: Based on the documentation [(1) ]() , Retell AI expects user prompts in a specific text format rather than nested objects:
Copy code
///## Identity
Your name is Mike.
Your date of birth is June 10, 1999.
///## Goal
Your primary objective is to return the package you received and get a refund.
///## Personality
You are a patient customer.
**Possible JSON structure to try**:
Copy code
json
[
  {
    "name": "Direct Opt-In",
    "user_prompt": "///## Identity\nYou are Ben Webb, a potential gym member.\n///## Goal\nYou want to book a studio tour this week.\n///## Personality\nFriendly and direct about your interest.",
    "success_criteria": "1. Verify that the agent skips discovery and proceeds to scheduling.\n2. Ensure the conversation ends with a confirmed tour booking.",
    "dynamic_variables": {
      "first_name": "Ben",
      "full_name": "Ben Webb",
      "email": "benandwebb@gmail.com"
    },
    "llm_model": "gpt-4o-mini"
  }
]
​ To learn more, see the sources I considered: [[1] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) [[2] Retell AI Introduces Simulation and Batch Testing for AI Agents | Retell AI](https://www.retellai.com/blog/retell-ai-introduces-simulation-and-batch-testing-for-ai-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.