Update an evaluator scenario
Updates the specified evaluator scenario.
PATCH
/
ai
/
tests
/
test_framework
/
v1
/
scenarios
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const EvaluatorScenarioDetail = await client.ai.tests.testFramework.v1.scenarios.update('id', {
name: 'name',
});
console.log(EvaluatorScenarioDetail.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
evaluator_scenario_detail = client.ai.tests.test_framework.v1.scenarios.update(
id="id",
name="name",
)
print(evaluator_scenario_detail.id)
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"),
)
scenario, err := client.AI.Tests.TestFramework.V1.Scenarios.Update(
context.TODO(),
"id",
telnyx.AITestTestFrameworkV1ScenarioUpdateParams{
Name: telnyx.String("name"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", scenario.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.ScenarioUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ScenarioUpdateParams params = ScenarioUpdateParams.builder()
.name("name")
.build();
var response = client.ai().tests().testFramework().v1().scenarios().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
evaluator_scenario_detail = telnyx.ai.tests.test_framework.v1.scenarios.update("id", name: "name")
puts(evaluator_scenario_detail)<?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 {
$evaluator_scenario_detail = $client->ai->tests->testFramework->v1->scenarios->update(
'id',
name: 'name',
);
var_dump($evaluator_scenario_detail);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:tests:test-framework:v1:scenarios update \
--api-key 'My API Key' \
--id id \
--name namecurl --request PATCH \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund escalation flow - updated",
"instructions": "Call the support line, demand a refund, and mention the damaged packaging.",
"metrics": [
266881,
266882
]
}
'{
"id": 9512,
"name": "Refund escalation flow",
"agent": 1259,
"project": null,
"personality": 4643,
"personality_name": "Interruptive (High)",
"tags": [
"support",
"regression"
],
"tool_ids": [],
"runs": [],
"metrics": [
266881,
266882
],
"metric_names": [
"AI interrupting user",
"Average Pitch (in Hz)"
],
"phone_number": "+13125550188",
"outbound_phone_number_data": null,
"first_message": "Hi, I want a refund.",
"inbound_phone_number": null,
"inbound_phone_number_data": null,
"instructions": "Call the support line and demand a refund for a damaged product.",
"simulation_description": "Simulates an impatient customer demanding a refund.",
"information_fields": null,
"expected_outcome_prompt": "The assistant explains the refund policy and offers escalation.",
"scenario_language": "en",
"scenario_type": "workflow",
"suite_type": "predefined",
"is_predefined": false,
"test_profile": null,
"test_profile_data": null,
"dynamic_variable_values": null,
"folder_path": null,
"max_duration": null
}{
"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
Body
application/json
Response
Updated evaluator scenario.
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 EvaluatorScenarioDetail = await client.ai.tests.testFramework.v1.scenarios.update('id', {
name: 'name',
});
console.log(EvaluatorScenarioDetail.id);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
evaluator_scenario_detail = client.ai.tests.test_framework.v1.scenarios.update(
id="id",
name="name",
)
print(evaluator_scenario_detail.id)
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"),
)
scenario, err := client.AI.Tests.TestFramework.V1.Scenarios.Update(
context.TODO(),
"id",
telnyx.AITestTestFrameworkV1ScenarioUpdateParams{
Name: telnyx.String("name"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", scenario.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.ScenarioUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ScenarioUpdateParams params = ScenarioUpdateParams.builder()
.name("name")
.build();
var response = client.ai().tests().testFramework().v1().scenarios().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
evaluator_scenario_detail = telnyx.ai.tests.test_framework.v1.scenarios.update("id", name: "name")
puts(evaluator_scenario_detail)<?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 {
$evaluator_scenario_detail = $client->ai->tests->testFramework->v1->scenarios->update(
'id',
name: 'name',
);
var_dump($evaluator_scenario_detail);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:tests:test-framework:v1:scenarios update \
--api-key 'My API Key' \
--id id \
--name namecurl --request PATCH \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/scenarios/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refund escalation flow - updated",
"instructions": "Call the support line, demand a refund, and mention the damaged packaging.",
"metrics": [
266881,
266882
]
}
'{
"id": 9512,
"name": "Refund escalation flow",
"agent": 1259,
"project": null,
"personality": 4643,
"personality_name": "Interruptive (High)",
"tags": [
"support",
"regression"
],
"tool_ids": [],
"runs": [],
"metrics": [
266881,
266882
],
"metric_names": [
"AI interrupting user",
"Average Pitch (in Hz)"
],
"phone_number": "+13125550188",
"outbound_phone_number_data": null,
"first_message": "Hi, I want a refund.",
"inbound_phone_number": null,
"inbound_phone_number_data": null,
"instructions": "Call the support line and demand a refund for a damaged product.",
"simulation_description": "Simulates an impatient customer demanding a refund.",
"information_fields": null,
"expected_outcome_prompt": "The assistant explains the refund policy and offers escalation.",
"scenario_language": "en",
"scenario_type": "workflow",
"suite_type": "predefined",
"is_predefined": false,
"test_profile": null,
"test_profile_data": null,
"dynamic_variable_values": null,
"folder_path": null,
"max_duration": null
}{
"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."
}
]
}