Run evaluator scenarios
Runs the selected evaluator scenarios against their test agents and creates a run batch. Returns the ID of the created batch, whose results can be listed with the test-run-results endpoints.
POST
/
ai
/
tests
/
test_framework
/
v1
/
scenarios
/
run_scenarios
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.tests.testFramework.v1.scenarios.runScenarios({
agent_id: 0,
});
console.log(response.status);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.tests.test_framework.v1.scenarios.run_scenarios(
agent_id=0,
)
print(response.status)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Tests.TestFramework.V1.Scenarios.RunScenarios(
context.TODO(),
telnyx.AITestTestFrameworkV1ScenarioRunScenariosParams{
AgentID: telnyx.Int64(1),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.tests.testFramework.v1.scenarios.ScenarioRunScenariosParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ScenarioRunScenariosParams params = ScenarioRunScenariosParams.builder()
.agentId(0)
.build();
var response = client.ai().tests().testFramework().v1().scenarios().runScenarios(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.tests.test_framework.v1.scenarios.run_scenarios(agent_id: 0)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->tests->testFramework->v1->scenarios->runScenarios(
agent_id: 0,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:tests:test-framework:v1:scenarios run-scenarios \
--api-key 'My API Key' \
--agent-id 0curl --request POST \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/run_scenarios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": 1259,
"scenarios": [
9512
],
"tags": [
"regression"
],
"mode": "same_number",
"concurrency_limit": 3
}
'{
"status": "in_queue",
"id": 10119
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The AI Tests service rejected the request."
}
]
}{
"errors": [
{
"code": "10003",
"title": "Unauthorized",
"detail": "The API key is missing or invalid."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Not Found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10018",
"title": "Unprocessable Entity",
"detail": "Validation failed for the request payload."
}
]
}{
"errors": [
{
"code": "10029",
"title": "Too Many Requests",
"detail": "Too many requests; retry later."
}
]
}{
"errors": [
{
"code": "10063",
"title": "Service Unavailable",
"detail": "The test framework service is temporarily unavailable."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Scenario IDs to run, or the literal string 'all'.
Available options:
same_number, different_numbers Maximum number of concurrent simulated calls.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.tests.testFramework.v1.scenarios.runScenarios({
agent_id: 0,
});
console.log(response.status);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.tests.test_framework.v1.scenarios.run_scenarios(
agent_id=0,
)
print(response.status)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Tests.TestFramework.V1.Scenarios.RunScenarios(
context.TODO(),
telnyx.AITestTestFrameworkV1ScenarioRunScenariosParams{
AgentID: telnyx.Int64(1),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.tests.testFramework.v1.scenarios.ScenarioRunScenariosParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ScenarioRunScenariosParams params = ScenarioRunScenariosParams.builder()
.agentId(0)
.build();
var response = client.ai().tests().testFramework().v1().scenarios().runScenarios(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.tests.test_framework.v1.scenarios.run_scenarios(agent_id: 0)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->tests->testFramework->v1->scenarios->runScenarios(
agent_id: 0,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:tests:test-framework:v1:scenarios run-scenarios \
--api-key 'My API Key' \
--agent-id 0curl --request POST \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/run_scenarios \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": 1259,
"scenarios": [
9512
],
"tags": [
"regression"
],
"mode": "same_number",
"concurrency_limit": 3
}
'{
"status": "in_queue",
"id": 10119
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The AI Tests service rejected the request."
}
]
}{
"errors": [
{
"code": "10003",
"title": "Unauthorized",
"detail": "The API key is missing or invalid."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Not Found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10018",
"title": "Unprocessable Entity",
"detail": "Validation failed for the request payload."
}
]
}{
"errors": [
{
"code": "10029",
"title": "Too Many Requests",
"detail": "Too many requests; retry later."
}
]
}{
"errors": [
{
"code": "10063",
"title": "Service Unavailable",
"detail": "The test framework service is temporarily unavailable."
}
]
}