Create Simulation Scenario
curl --request POST \
--url https://api.eqho.ai/v1/simulation/scenarios \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'x-org-id: <api-key>' \
--data @- <<EOF
{
"description": {
"purpose": "Test that agent refuses cancellation with refund if criteria are not met"
},
"environment_setup": {
"action_mocks": {
"check_refund_eligibility": {
"default_is_error": false,
"default_return_value": "False"
}
},
"dynamic_variables": {
"lead.custom_fields.ticket_type": "non-refundable"
}
},
"evaluation_criteria": {
"nl_assertions": [
"Agent does not offer the refund because reservation doesn't meet policy criteria."
]
},
"folder": "Flight cancellation",
"lead_scenario": {
"instructions": {
"known_info": "You are Amelia Sanchez.\n\nYour user id is amelia_sanchez_4739.",
"reason_for_call": "You want to cancel your flights from MCO to CLT.",
"task_instructions": "You insist to cancel and have the refund."
},
"persona": "As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund."
},
"name": "Agent refuses cancellation with refund if criteria are not met"
}
EOFimport requests
url = "https://api.eqho.ai/v1/simulation/scenarios"
payload = {
"description": { "purpose": "Test that agent refuses cancellation with refund if criteria are not met" },
"environment_setup": {
"action_mocks": { "check_refund_eligibility": {
"default_is_error": False,
"default_return_value": "False"
} },
"dynamic_variables": { "lead.custom_fields.ticket_type": "non-refundable" }
},
"evaluation_criteria": { "nl_assertions": ["Agent does not offer the refund because reservation doesn't meet policy criteria."] },
"folder": "Flight cancellation",
"lead_scenario": {
"instructions": {
"known_info": "You are Amelia Sanchez.
Your user id is amelia_sanchez_4739.",
"reason_for_call": "You want to cancel your flights from MCO to CLT.",
"task_instructions": "You insist to cancel and have the refund."
},
"persona": "As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund."
},
"name": "Agent refuses cancellation with refund if criteria are not met"
}
headers = {
"X-API-KEY": "<api-key>",
"x-org-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'x-org-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: {
purpose: 'Test that agent refuses cancellation with refund if criteria are not met'
},
environment_setup: {
action_mocks: {
check_refund_eligibility: {default_is_error: false, default_return_value: 'False'}
},
dynamic_variables: {'lead.custom_fields.ticket_type': 'non-refundable'}
},
evaluation_criteria: {
nl_assertions: [
'Agent does not offer the refund because reservation doesn\'t meet policy criteria.'
]
},
folder: 'Flight cancellation',
lead_scenario: {
instructions: {
known_info: 'You are Amelia Sanchez.\n\nYour user id is amelia_sanchez_4739.',
reason_for_call: 'You want to cancel your flights from MCO to CLT.',
task_instructions: 'You insist to cancel and have the refund.'
},
persona: 'As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund.'
},
name: 'Agent refuses cancellation with refund if criteria are not met'
})
};
fetch('https://api.eqho.ai/v1/simulation/scenarios', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eqho.ai/v1/simulation/scenarios"
payload := strings.NewReader("{\n \"description\": {\n \"purpose\": \"Test that agent refuses cancellation with refund if criteria are not met\"\n },\n \"environment_setup\": {\n \"action_mocks\": {\n \"check_refund_eligibility\": {\n \"default_is_error\": false,\n \"default_return_value\": \"False\"\n }\n },\n \"dynamic_variables\": {\n \"lead.custom_fields.ticket_type\": \"non-refundable\"\n }\n },\n \"evaluation_criteria\": {\n \"nl_assertions\": [\n \"Agent does not offer the refund because reservation doesn't meet policy criteria.\"\n ]\n },\n \"folder\": \"Flight cancellation\",\n \"lead_scenario\": {\n \"instructions\": {\n \"known_info\": \"You are Amelia Sanchez.\\n\\nYour user id is amelia_sanchez_4739.\",\n \"reason_for_call\": \"You want to cancel your flights from MCO to CLT.\",\n \"task_instructions\": \"You insist to cancel and have the refund.\"\n },\n \"persona\": \"As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund.\"\n },\n \"name\": \"Agent refuses cancellation with refund if criteria are not met\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("x-org-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"_id": "<string>",
"account_id": "<string>",
"name": "<string>",
"lead_scenario": {
"instructions": {
"task_instructions": "You are acting as a lead in the following conversation, follow lead script precisely: {{transcript}}",
"language": "en",
"reason_for_call": "<string>",
"known_info": "<string>",
"unknown_info": "<string>"
},
"persona": "<string>",
"actions": {
"terminate_call": {
"name": "<string>",
"slug": "<string>",
"instructions": "<string>",
"type": "call_transfer",
"settings": {},
"messages": {
"start": "[{{action.function_name}} (id: {{action.execution_id}}) is being processed, continue conversation in a nice manner, you will be notified when it's done. Do not call this function again until you receive the result.]",
"completed": "[{{action.function_name}} (id: {{action.execution_id}}) is done] result: {{action.result}}",
"failed": "[{{action.function_name}} (id: {{action.execution_id}}) has failed.] error: {{action.error}}",
"delayed": "[{{action.function_name}} (id: {{action.execution_id}}) has been delayed.]",
"timed_out": "[{{action.function_name}} (id: {{action.execution_id}}) timed out after {{action.timeout_seconds}}s]",
"cancelled": "[{{action.function_name}} (id: {{action.execution_id}}) has been cancelled.]"
},
"minimum_execution_time_milliseconds": 123,
"delayed_timing_milliseconds": 123,
"is_async": false,
"non_live_llm_settings": {
"model": "gpt-4o-mini",
"temperature": 0,
"reasoning": "none"
},
"execution_type": "live",
"response_mode": "interactive",
"execution_order": 123,
"execution_mode": "foreground",
"result_delivery_mode": "when_idle",
"timeout_seconds": 30,
"timeout_mode": "notify",
"cancellable": true
}
}
},
"history": {
"last_modified_at": "2023-11-07T05:31:56Z",
"revision": 0,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "unknown",
"last_modified_by": "unknown"
},
"scenario_set_id": "<string>",
"folder": "<string>",
"description": {
"purpose": "<string>",
"notes": "<string>"
},
"environment_setup": {
"dynamic_variables": {
"lead.custom_fields.membership_status": "gold"
},
"conversation_direction": "inbound",
"conversation_medium": "chatbot",
"action_mocks": {},
"message_history": [
{
"content": "<string>",
"role": "system",
"turn_idx": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"evaluation_criteria": {
"actions": [
{
"tool_call_id": "<string>",
"name": "<string>",
"arguments": {},
"requestor": "assistant",
"info": "<string>",
"compare_args": [
"<string>"
]
}
],
"nl_assertions": [
"<string>"
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Scenarios
Create Scenario
Create a new simulation scenario
POST
/
v1
/
simulation
/
scenarios
Create Simulation Scenario
curl --request POST \
--url https://api.eqho.ai/v1/simulation/scenarios \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'x-org-id: <api-key>' \
--data @- <<EOF
{
"description": {
"purpose": "Test that agent refuses cancellation with refund if criteria are not met"
},
"environment_setup": {
"action_mocks": {
"check_refund_eligibility": {
"default_is_error": false,
"default_return_value": "False"
}
},
"dynamic_variables": {
"lead.custom_fields.ticket_type": "non-refundable"
}
},
"evaluation_criteria": {
"nl_assertions": [
"Agent does not offer the refund because reservation doesn't meet policy criteria."
]
},
"folder": "Flight cancellation",
"lead_scenario": {
"instructions": {
"known_info": "You are Amelia Sanchez.\n\nYour user id is amelia_sanchez_4739.",
"reason_for_call": "You want to cancel your flights from MCO to CLT.",
"task_instructions": "You insist to cancel and have the refund."
},
"persona": "As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund."
},
"name": "Agent refuses cancellation with refund if criteria are not met"
}
EOFimport requests
url = "https://api.eqho.ai/v1/simulation/scenarios"
payload = {
"description": { "purpose": "Test that agent refuses cancellation with refund if criteria are not met" },
"environment_setup": {
"action_mocks": { "check_refund_eligibility": {
"default_is_error": False,
"default_return_value": "False"
} },
"dynamic_variables": { "lead.custom_fields.ticket_type": "non-refundable" }
},
"evaluation_criteria": { "nl_assertions": ["Agent does not offer the refund because reservation doesn't meet policy criteria."] },
"folder": "Flight cancellation",
"lead_scenario": {
"instructions": {
"known_info": "You are Amelia Sanchez.
Your user id is amelia_sanchez_4739.",
"reason_for_call": "You want to cancel your flights from MCO to CLT.",
"task_instructions": "You insist to cancel and have the refund."
},
"persona": "As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund."
},
"name": "Agent refuses cancellation with refund if criteria are not met"
}
headers = {
"X-API-KEY": "<api-key>",
"x-org-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'x-org-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: {
purpose: 'Test that agent refuses cancellation with refund if criteria are not met'
},
environment_setup: {
action_mocks: {
check_refund_eligibility: {default_is_error: false, default_return_value: 'False'}
},
dynamic_variables: {'lead.custom_fields.ticket_type': 'non-refundable'}
},
evaluation_criteria: {
nl_assertions: [
'Agent does not offer the refund because reservation doesn\'t meet policy criteria.'
]
},
folder: 'Flight cancellation',
lead_scenario: {
instructions: {
known_info: 'You are Amelia Sanchez.\n\nYour user id is amelia_sanchez_4739.',
reason_for_call: 'You want to cancel your flights from MCO to CLT.',
task_instructions: 'You insist to cancel and have the refund.'
},
persona: 'As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund.'
},
name: 'Agent refuses cancellation with refund if criteria are not met'
})
};
fetch('https://api.eqho.ai/v1/simulation/scenarios', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eqho.ai/v1/simulation/scenarios"
payload := strings.NewReader("{\n \"description\": {\n \"purpose\": \"Test that agent refuses cancellation with refund if criteria are not met\"\n },\n \"environment_setup\": {\n \"action_mocks\": {\n \"check_refund_eligibility\": {\n \"default_is_error\": false,\n \"default_return_value\": \"False\"\n }\n },\n \"dynamic_variables\": {\n \"lead.custom_fields.ticket_type\": \"non-refundable\"\n }\n },\n \"evaluation_criteria\": {\n \"nl_assertions\": [\n \"Agent does not offer the refund because reservation doesn't meet policy criteria.\"\n ]\n },\n \"folder\": \"Flight cancellation\",\n \"lead_scenario\": {\n \"instructions\": {\n \"known_info\": \"You are Amelia Sanchez.\\n\\nYour user id is amelia_sanchez_4739.\",\n \"reason_for_call\": \"You want to cancel your flights from MCO to CLT.\",\n \"task_instructions\": \"You insist to cancel and have the refund.\"\n },\n \"persona\": \"As a 41-year-old office administrator, you are pragmatic and to the point. You are polite but firm in your request for a refund.\"\n },\n \"name\": \"Agent refuses cancellation with refund if criteria are not met\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("x-org-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"_id": "<string>",
"account_id": "<string>",
"name": "<string>",
"lead_scenario": {
"instructions": {
"task_instructions": "You are acting as a lead in the following conversation, follow lead script precisely: {{transcript}}",
"language": "en",
"reason_for_call": "<string>",
"known_info": "<string>",
"unknown_info": "<string>"
},
"persona": "<string>",
"actions": {
"terminate_call": {
"name": "<string>",
"slug": "<string>",
"instructions": "<string>",
"type": "call_transfer",
"settings": {},
"messages": {
"start": "[{{action.function_name}} (id: {{action.execution_id}}) is being processed, continue conversation in a nice manner, you will be notified when it's done. Do not call this function again until you receive the result.]",
"completed": "[{{action.function_name}} (id: {{action.execution_id}}) is done] result: {{action.result}}",
"failed": "[{{action.function_name}} (id: {{action.execution_id}}) has failed.] error: {{action.error}}",
"delayed": "[{{action.function_name}} (id: {{action.execution_id}}) has been delayed.]",
"timed_out": "[{{action.function_name}} (id: {{action.execution_id}}) timed out after {{action.timeout_seconds}}s]",
"cancelled": "[{{action.function_name}} (id: {{action.execution_id}}) has been cancelled.]"
},
"minimum_execution_time_milliseconds": 123,
"delayed_timing_milliseconds": 123,
"is_async": false,
"non_live_llm_settings": {
"model": "gpt-4o-mini",
"temperature": 0,
"reasoning": "none"
},
"execution_type": "live",
"response_mode": "interactive",
"execution_order": 123,
"execution_mode": "foreground",
"result_delivery_mode": "when_idle",
"timeout_seconds": 30,
"timeout_mode": "notify",
"cancellable": true
}
}
},
"history": {
"last_modified_at": "2023-11-07T05:31:56Z",
"revision": 0,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "unknown",
"last_modified_by": "unknown"
},
"scenario_set_id": "<string>",
"folder": "<string>",
"description": {
"purpose": "<string>",
"notes": "<string>"
},
"environment_setup": {
"dynamic_variables": {
"lead.custom_fields.membership_status": "gold"
},
"conversation_direction": "inbound",
"conversation_medium": "chatbot",
"action_mocks": {},
"message_history": [
{
"content": "<string>",
"role": "system",
"turn_idx": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"evaluation_criteria": {
"actions": [
{
"tool_call_id": "<string>",
"name": "<string>",
"arguments": {},
"requestor": "assistant",
"info": "<string>",
"compare_args": [
"<string>"
]
}
],
"nl_assertions": [
"<string>"
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
APIKeyHeader & OrgImpersonationOAuth2PasswordBearer & OrgImpersonation
Body
application/json
Response
Successful Response
A simulation scenario template that defines how to simulate a conversation
See Also:
- SimulationRunModel: Individual execution of this scenario
- ScenarioSetModel: Grouping multiple scenarios together
- SimulationResultsModel: Aggregated results from running scenarios
Was this page helpful?