Update an assistant test
Updates an existing assistant test configuration with new settings
PUT
/
ai
/
assistants
/
tests
/
{test_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 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
Body
application/json
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.
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.
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 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"
}
]
}