curl --request POST \
--url https://app.miyon.ai/api/v1/evals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Opening hours",
"cases": [
{
"name": "asks for hours",
"turns": [
{
"user_input": "When are you open?",
"assistant_contains_any": [
"9",
"nine"
]
}
]
}
],
"agent_id": 42
}
'import requests
url = "https://app.miyon.ai/api/v1/evals"
payload = {
"name": "Opening hours",
"cases": [
{
"name": "asks for hours",
"turns": [
{
"user_input": "When are you open?",
"assistant_contains_any": ["9", "nine"]
}
]
}
],
"agent_id": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Opening hours',
cases: [
{
name: 'asks for hours',
turns: [{user_input: 'When are you open?', assistant_contains_any: ['9', 'nine']}]
}
],
agent_id: 42
})
};
fetch('https://app.miyon.ai/api/v1/evals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miyon.ai/api/v1/evals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Opening hours',
'cases' => [
[
'name' => 'asks for hours',
'turns' => [
[
'user_input' => 'When are you open?',
'assistant_contains_any' => [
'9',
'nine'
]
]
]
]
],
'agent_id' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.miyon.ai/api/v1/evals"
payload := strings.NewReader("{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://app.miyon.ai/api/v1/evals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miyon.ai/api/v1/evals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"slug": "<string>",
"active": true,
"cases": [
{
"id": 123,
"name": "<string>",
"position": 123,
"mode": "scripted",
"turns": [
{
"id": 123,
"name": "<string>",
"position": 123,
"user_input": "<string>",
"no_more_events": true,
"original_assistant_response": "<string>",
"assistant_intent": "<string>",
"assistant_contains": [
"<string>"
],
"assistant_contains_any": [
"<string>"
],
"assistant_not_contains": [
"<string>"
],
"tool_calls": [
{
"name": "<string>",
"arguments_contains": {}
}
],
"source": {
"conversation_id": 123,
"conversation_name": "<string>",
"imported_at": "2023-11-07T05:31:56Z"
}
}
],
"context": "<string>",
"source": {
"conversation_id": 123,
"conversation_name": "<string>",
"imported_at": "2023-11-07T05:31:56Z"
},
"user_persona": "<string>",
"opening_message": "<string>",
"max_turns": 123,
"goal_intent": "<string>",
"goal_tool_calls": [
{
"name": "<string>"
}
]
}
],
"recent_runs": [
{
"id": 123,
"status": "pending",
"sequence_number": 123,
"total_cases": 123,
"passed_cases": 123,
"failed_cases": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"duration": 123,
"results": "<unknown>",
"error_message": "<string>"
}
],
"runs_pagination": {
"current_page": 123,
"total_pages": 123,
"total_entries": 123
},
"agent_id": 123,
"description": "<string>",
"number_id": 123,
"number_name": "<string>",
"meta": {
"caller_model": "<string>",
"judge_model": "<string>",
"mock_responses": {},
"tool_variants": [
{
"name": "<string>",
"prompt_override": "<string>",
"system_override": "<string>",
"model_override": "<string>",
"temperature_override": "<string>",
"tool_overrides": {}
}
]
},
"latest_run": {
"id": 123,
"status": "pending",
"total_cases": 123,
"passed_cases": 123,
"failed_cases": 123,
"completed_at": "2023-11-07T05:31:56Z"
},
"agent_name": "<string>"
}Create an eval scenario
Create a scenario with at least one case. slug is generated from name.
curl --request POST \
--url https://app.miyon.ai/api/v1/evals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Opening hours",
"cases": [
{
"name": "asks for hours",
"turns": [
{
"user_input": "When are you open?",
"assistant_contains_any": [
"9",
"nine"
]
}
]
}
],
"agent_id": 42
}
'import requests
url = "https://app.miyon.ai/api/v1/evals"
payload = {
"name": "Opening hours",
"cases": [
{
"name": "asks for hours",
"turns": [
{
"user_input": "When are you open?",
"assistant_contains_any": ["9", "nine"]
}
]
}
],
"agent_id": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Opening hours',
cases: [
{
name: 'asks for hours',
turns: [{user_input: 'When are you open?', assistant_contains_any: ['9', 'nine']}]
}
],
agent_id: 42
})
};
fetch('https://app.miyon.ai/api/v1/evals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miyon.ai/api/v1/evals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Opening hours',
'cases' => [
[
'name' => 'asks for hours',
'turns' => [
[
'user_input' => 'When are you open?',
'assistant_contains_any' => [
'9',
'nine'
]
]
]
]
],
'agent_id' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.miyon.ai/api/v1/evals"
payload := strings.NewReader("{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://app.miyon.ai/api/v1/evals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miyon.ai/api/v1/evals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Opening hours\",\n \"cases\": [\n {\n \"name\": \"asks for hours\",\n \"turns\": [\n {\n \"user_input\": \"When are you open?\",\n \"assistant_contains_any\": [\n \"9\",\n \"nine\"\n ]\n }\n ]\n }\n ],\n \"agent_id\": 42\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"slug": "<string>",
"active": true,
"cases": [
{
"id": 123,
"name": "<string>",
"position": 123,
"mode": "scripted",
"turns": [
{
"id": 123,
"name": "<string>",
"position": 123,
"user_input": "<string>",
"no_more_events": true,
"original_assistant_response": "<string>",
"assistant_intent": "<string>",
"assistant_contains": [
"<string>"
],
"assistant_contains_any": [
"<string>"
],
"assistant_not_contains": [
"<string>"
],
"tool_calls": [
{
"name": "<string>",
"arguments_contains": {}
}
],
"source": {
"conversation_id": 123,
"conversation_name": "<string>",
"imported_at": "2023-11-07T05:31:56Z"
}
}
],
"context": "<string>",
"source": {
"conversation_id": 123,
"conversation_name": "<string>",
"imported_at": "2023-11-07T05:31:56Z"
},
"user_persona": "<string>",
"opening_message": "<string>",
"max_turns": 123,
"goal_intent": "<string>",
"goal_tool_calls": [
{
"name": "<string>"
}
]
}
],
"recent_runs": [
{
"id": 123,
"status": "pending",
"sequence_number": 123,
"total_cases": 123,
"passed_cases": 123,
"failed_cases": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"duration": 123,
"results": "<unknown>",
"error_message": "<string>"
}
],
"runs_pagination": {
"current_page": 123,
"total_pages": 123,
"total_entries": 123
},
"agent_id": 123,
"description": "<string>",
"number_id": 123,
"number_name": "<string>",
"meta": {
"caller_model": "<string>",
"judge_model": "<string>",
"mock_responses": {},
"tool_variants": [
{
"name": "<string>",
"prompt_override": "<string>",
"system_override": "<string>",
"model_override": "<string>",
"temperature_override": "<string>",
"tool_overrides": {}
}
]
},
"latest_run": {
"id": 123,
"status": "pending",
"total_cases": 123,
"passed_cases": 123,
"failed_cases": 123,
"completed_at": "2023-11-07T05:31:56Z"
},
"agent_name": "<string>"
}Autorisierungen
Scoped API token. Required scopes are listed on each operation in x-required-scopes.
Body
Request body for create and replace. id, slug, active and position are ignored if sent.
Scenario name. slug is generated from it (lowercase letters, digits and underscores).
Test cases of the scenario.
1Show child attributes
Show child attributes
The voice agent to evaluate (its id from GET /api/v1/voice_agents).
Deprecated alias of agent_id.
Free-text description.
Models and overrides used when running the scenario.
Show child attributes
Show child attributes
Antwort
The created scenario.
Full scenario as returned by get, create, replace and duplicate.
ID of the scenario.
Scenario name.
URL-safe identifier generated from name.
Whether the scenario is active in the dashboard.
Test cases in order.
Show child attributes
Show child attributes
A page of recent runs, newest first.
Show child attributes
Show child attributes
Paging information for recent_runs.
Show child attributes
Show child attributes
The voice agent the scenario tests.
Free-text description.
Deprecated alias of agent_id.
Deprecated alias of agent_name.
Models and overrides used when running the scenario.
Show child attributes
Show child attributes
Summary of the most recent run.
Show child attributes
Show child attributes
Name of that voice agent.