OmniDim Logo

    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

    1
    Create Simulation
    2
    Start Simulation
    3
    Monitor Progress
    4
    Analyze Results
    5
    Get Enhanced Prompt
    6
    Apply Improvements (Optional)

    Simulation Status Values

    Draft
    Pending
    In Progress
    Calculating Summary
    Completed
    Stopped

    Create Simulation

    Create a new simulation with specified scenarios to test your agent's performance.

    Parameters

    name
    string
    Required

    Name of the simulation for identification

    agent_id
    int
    Required

    ID of the agent to test

    number_of_call_to_make
    int
    Optional

    Number of calls to make per scenario (default: 1 , max: 3)

    concurrent_call_count
    int
    Optional

    Number of concurrent calls to run (default: 3, max: 3 )

    max_call_duration_in_minutes
    int
    Optional

    Maximum duration for each call in minutes (default: 3, max: 10)

    scenarios
    array
    Optional

    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)

    List Simulations

    Retrieve all simulations for the authenticated user with pagination support.

    Parameters

    pageno
    int
    Optional

    Page number for pagination (default: 1)

    pagesize
    int
    Optional

    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

    simulation_id
    int
    Required

    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

    simulation_id
    int
    Required

    The ID of the simulation to update

    data
    dict
    Required

    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)

    Delete Simulation

    Delete (deactivate) a simulation. Running simulations are automatically stopped first.

    Parameters

    simulation_id
    int
    Required

    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

    simulation_id
    int
    Required

    The ID of the simulation to start

    scenarios
    array
    Optional

    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

    simulation_id
    int
    Required

    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

    simulation_id
    int
    Required

    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)

    Rate Limits & Error Handling

    Common Error Codes

    unauthorizedInvalid or missing API key
    not_foundResource not found or access denied
    invalid_requestMissing required fields
    invalid_stateOperation not allowed in current state
    server_errorInternal server error