Simulation
The Simulation module allows you to create, manage, and run automated tests for your AI voice agents. Test different conversation scenarios to ensure your agents perform optimally across various use cases.
Overview
Simulations provide comprehensive testing capabilities for your AI agents:
- Create test scenarios with specific conversation flows
- Run multiple concurrent test calls with different voices
- Analyze conversation quality and agent performance
- Get AI-powered suggestions for prompt improvements
- Apply enhanced prompts directly to your agents
Simulation Workflow
Simulation Status Values
Create Simulation
Create a new simulation with specified scenarios to test your agent's performance.
Parameters
Name of the simulation for identification
ID of the agent to test
Number of calls to make per scenario (default: 1 , max: 3)
Number of concurrent calls to run (default: 3, max: 3 )
Maximum duration for each call in minutes (default: 3, max: 10)
List of test scenarios to execute
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from omnidimension import Client
client = Client(api_key)
# Create a basic simulation
response = client.simulation.create(
name="Restaurant Order Taking Test",
agent_id=123,
number_of_call_to_make=1,
concurrent_call_count=3,
max_call_duration_in_minutes=3,
scenarios=[
{
"name": "Order Pizza",
"description": "1. Act as a customer wanting to order pizza\n2. Ask for menu items\n3. Order a large pepperoni pizza\n4. Provide contact details\n5. End call with thank you",
"expected_result": "Order should be placed successfully and confirmation provided",
"selected_voices": [
{"id": "voice_id_1", "provider": "eleven_labs"},
{"id": "voice_id_2", "provider": "play_ht"}
]
}
]
)
print(response)
Note
List Simulations
Retrieve all simulations for the authenticated user with pagination support.
Parameters
Page number for pagination (default: 1)
Number of records per page (default: 10)
Example
1
2
3
4
5
6
from omnidimension import Client
client = Client(api_key)
# List all simulations with pagination
response = client.simulation.list(pageno=1, pagesize=10)
print(response)
Get Simulation Detail
Retrieve detailed information about a specific simulation including status, progress, and results.
Parameters
The ID of the simulation to retrieve
Example
1
2
3
4
5
6
7
from omnidimension import Client
client = Client(api_key)
# Get details of a specific simulation
simulation_id = 456
response = client.simulation.get(simulation_id)
print(response)
Update Simulation
Update an existing simulation. Cannot update simulations that are currently in progress.
Parameters
The ID of the simulation to update
Dictionary containing the fields to update. Can include any field from create simulation.
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from omnidimension import Client
client = Client(api_key)
# Update an existing simulation
simulation_id = 456
update_data = {
"name": "Updated Restaurant Test",
"max_call_duration_in_minutes": 5,
"scenarios": [
{
"name": "Updated Order Pizza",
"description": "Updated instructions...",
"expected_result": "Updated expected behavior..."
}
]
}
response = client.simulation.update(simulation_id, update_data)
print(response)
Note
Delete Simulation
Delete (deactivate) a simulation. Running simulations are automatically stopped first.
Parameters
The ID of the simulation to delete
Example
1
2
3
4
5
6
7
from omnidimension import Client
client = Client(api_key)
# Delete a simulation
simulation_id = 456
response = client.simulation.delete(simulation_id)
print(response)
Start Simulation
Start a simulation. You can optionally update scenarios before starting the test run.
Parameters
The ID of the simulation to start
Optional array of scenarios to update before starting
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from omnidimension import Client
client = Client(api_key)
# Start a simulation
simulation_id = 456
response = client.simulation.start(simulation_id)
print(response)
# Start with updated scenarios
response = client.simulation.start(
simulation_id,
scenarios=[
{
"id": 789,
"name": "Updated Order Pizza",
"description": "Updated instructions...",
"expected_result": "Updated expected behavior...",
"selected_voices": [...]
}
]
)
print(response)
Stop Running Simulation
Stop a running simulation and disconnect any ongoing test calls.
Parameters
The ID of the simulation to stop
Example
1
2
3
4
5
6
7
from omnidimension import Client
client = Client(api_key)
# Stop a running simulation
simulation_id = 456
response = client.simulation.stop(simulation_id)
print(response)
Get Enhanced Prompt Suggestions
Analyze a completed simulation and receive AI-powered suggestions for improving your agent's prompts and performance.
Parameters
The ID of the completed simulation to analyze
Example
1
2
3
4
5
6
7
from omnidimension import Client
client = Client(api_key)
# Get enhanced prompt suggestions
simulation_id = 456
response = client.simulation.enhance_prompt(simulation_id)
print(response)
Note
Rate Limits & Error Handling
Rate Limits
Common Error Codes
unauthorized
Invalid or missing API keynot_found
Resource not found or access deniedinvalid_request
Missing required fieldsinvalid_state
Operation not allowed in current stateserver_error
Internal server error