Update an assistant test
Updates an existing assistant test configuration with new settings
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistantTest = await client.ai.assistants.tests.update('test_id');
console.log(assistantTest.test_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
)
assistant_test = client.ai.assistants.tests.update(
test_id="test_id",
)
print(assistant_test.test_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"),
)
assistantTest, err := client.AI.Assistants.Tests.Update(
context.TODO(),
"test_id",
telnyx.AIAssistantTestUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantTest.TestID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tests.AssistantTest;
import com.telnyx.sdk.models.ai.assistants.tests.TestUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantTest assistantTest = client.ai().assistants().tests().update("test_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant_test = telnyx.ai.assistants.tests.update("test_id")
puts(assistant_test)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\AI\Assistants\Tests\TelnyxConversationChannel;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistantTest = $client->ai->assistants->tests->update(
'test_id',
description: 'description',
destination: 'x',
instructions: 'x',
maxDurationSeconds: 1,
name: 'x',
rubric: [['criteria' => 'criteria', 'name' => 'name']],
telnyxConversationChannel: TelnyxConversationChannel::PHONE_CALL,
testSuite: 'test_suite',
);
var_dump($assistantTest);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests update \
--api-key 'My API Key' \
--test-id test_idcurl --request PUT \
--url https://api.telnyx.com/v2/ai/assistants/tests/{test_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Name",
"description": "Description",
"telnyx_conversation_channel": "phone_call",
"destination": "Destination",
"max_duration_seconds": 30,
"test_suite": "Test Suite",
"instructions": "Instructions",
"rubric": [
{
"name": "string",
"criteria": "string"
}
]
}
'{
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot Test",
"telnyx_conversation_channel": "web_chat",
"rubric": [
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
],
"created_at": "2024-01-16T09:00:00Z",
"description": "<string>",
"destination": "<string>",
"max_duration_seconds": 123,
"test_suite": "<string>",
"instructions": "<string>"
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the test.
Body
Request model for updating an existing assistant test.
All fields are optional, allowing partial updates of test configuration. Only provided fields will be updated, others remain unchanged.
Updated name for the assistant test. Must be unique and descriptive.
1 - 255Updated description of the test's purpose and evaluation criteria.
1000Updated communication channel for the test execution.
phone_call, web_call, sms_chat, web_chat Updated target destination for test conversations.
1Updated maximum test duration in seconds.
1 <= x <= 3600Updated test suite assignment for better organization.
100Updated test scenario instructions and objectives.
1 - 5000Updated evaluation criteria for assessing assistant performance.
1Show child attributes
Show child attributes
Response
Returns the updated test configuration with all changes applied
Response model containing complete assistant test information.
Returns all test configuration details including evaluation criteria, scheduling, and metadata. Used when retrieving individual tests or after creating/updating tests.
Unique identifier for the assistant test.
"123e4567-e89b-12d3-a456-426614174000"
Human-readable name of the test.
"Customer Support Bot Test"
Communication channel used for test execution.
phone_call, web_call, sms_chat, web_chat "web_chat"
Evaluation criteria used to assess test performance.
Show child attributes
Show child attributes
[
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
]
Timestamp when the test was created.
"2024-01-16T09:00:00Z"
Detailed description of the test's purpose and scope.
Target destination for test conversations.
Maximum allowed duration for test execution in seconds.
Test suite grouping for organizational purposes.
Detailed test scenario instructions and objectives.
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistantTest = await client.ai.assistants.tests.update('test_id');
console.log(assistantTest.test_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
)
assistant_test = client.ai.assistants.tests.update(
test_id="test_id",
)
print(assistant_test.test_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"),
)
assistantTest, err := client.AI.Assistants.Tests.Update(
context.TODO(),
"test_id",
telnyx.AIAssistantTestUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistantTest.TestID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tests.AssistantTest;
import com.telnyx.sdk.models.ai.assistants.tests.TestUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantTest assistantTest = client.ai().assistants().tests().update("test_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant_test = telnyx.ai.assistants.tests.update("test_id")
puts(assistant_test)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\AI\Assistants\Tests\TelnyxConversationChannel;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$assistantTest = $client->ai->assistants->tests->update(
'test_id',
description: 'description',
destination: 'x',
instructions: 'x',
maxDurationSeconds: 1,
name: 'x',
rubric: [['criteria' => 'criteria', 'name' => 'name']],
telnyxConversationChannel: TelnyxConversationChannel::PHONE_CALL,
testSuite: 'test_suite',
);
var_dump($assistantTest);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests update \
--api-key 'My API Key' \
--test-id test_idcurl --request PUT \
--url https://api.telnyx.com/v2/ai/assistants/tests/{test_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Name",
"description": "Description",
"telnyx_conversation_channel": "phone_call",
"destination": "Destination",
"max_duration_seconds": 30,
"test_suite": "Test Suite",
"instructions": "Instructions",
"rubric": [
{
"name": "string",
"criteria": "string"
}
]
}
'{
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot Test",
"telnyx_conversation_channel": "web_chat",
"rubric": [
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
],
"created_at": "2024-01-16T09:00:00Z",
"description": "<string>",
"destination": "<string>",
"max_duration_seconds": 123,
"test_suite": "<string>",
"instructions": "<string>"
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}