Trigger a manual test run
Initiates immediate execution of a specific assistant test
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const testRunResponse = await client.ai.assistants.tests.runs.trigger('test_id');
console.log(testRunResponse.run_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
)
test_run_response = client.ai.assistants.tests.runs.trigger(
test_id="test_id",
)
print(test_run_response.run_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"),
)
testRunResponse, err := client.AI.Assistants.Tests.Runs.Trigger(
context.TODO(),
"test_id",
telnyx.AIAssistantTestRunTriggerParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testRunResponse.RunID)
}
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.runs.RunTriggerParams;
import com.telnyx.sdk.models.ai.assistants.tests.runs.TestRunResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestRunResponse testRunResponse = client.ai().assistants().tests().runs().trigger("test_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
test_run_response = telnyx.ai.assistants.tests.runs.trigger("test_id")
puts(test_run_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 {
$testRunResponse = $client->ai->assistants->tests->runs->trigger(
'test_id', destinationVersionID: '123e4567-e89b-12d3-a456-426614174000'
);
var_dump($testRunResponse);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests:runs trigger \
--api-key 'My API Key' \
--test-id test_idcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/tests/{test_id}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_version_id": "123e4567-e89b-12d3-a456-426614174000"
}
'{
"run_id": "987fcdeb-51a2-43d1-b456-426614174000",
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"triggered_by": "cron",
"created_at": "2024-01-24T10:30:00Z",
"completed_at": "2023-11-07T05:31:56Z",
"logs": "<string>",
"conversation_id": "<string>",
"conversation_insights_id": "<string>",
"test_suite_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"detail_status": [
{
"name": "<string>",
"status": "pending"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}Authorizations
Headers
Optional opaque, unquoted key for safely retrying the same logical request. Keys must contain 1 to 255 letters, numbers, hyphens, or underscores. Generate a unique UUID v4 for each operation and reuse it only when retrying that operation with the same request. Invalid headers—including duplicate, empty, malformed, or overlong values—return 400 with error code 10015. A request already in progress with the same key returns 409; reusing the key with a different request returns 422. Only successful responses are replayed, for up to 24 hours. Do not include sensitive data in the key.
1 - 255^[A-Za-z0-9_-]{1,255}$Body
Request model for triggering a single test run.
Optional request body for the trigger test run endpoint.
Response
Returns the created test run with execution details and status
Response model containing test run execution details and results.
Provides comprehensive information about a test execution including status, timing, logs, and detailed evaluation results.
Represents the lifecycle of a test:
- 'pending': Test is waiting to be executed.
- 'starting': Test execution is initializing.
- 'running': Test is currently executing.
- 'passed': Test completed successfully.
- 'failed': Test executed but did not pass.
- 'error': An error occurred during test execution.
pending, starting, running, passed, failed, error 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 testRunResponse = await client.ai.assistants.tests.runs.trigger('test_id');
console.log(testRunResponse.run_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
)
test_run_response = client.ai.assistants.tests.runs.trigger(
test_id="test_id",
)
print(test_run_response.run_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"),
)
testRunResponse, err := client.AI.Assistants.Tests.Runs.Trigger(
context.TODO(),
"test_id",
telnyx.AIAssistantTestRunTriggerParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testRunResponse.RunID)
}
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.runs.RunTriggerParams;
import com.telnyx.sdk.models.ai.assistants.tests.runs.TestRunResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestRunResponse testRunResponse = client.ai().assistants().tests().runs().trigger("test_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
test_run_response = telnyx.ai.assistants.tests.runs.trigger("test_id")
puts(test_run_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 {
$testRunResponse = $client->ai->assistants->tests->runs->trigger(
'test_id', destinationVersionID: '123e4567-e89b-12d3-a456-426614174000'
);
var_dump($testRunResponse);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests:runs trigger \
--api-key 'My API Key' \
--test-id test_idcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/tests/{test_id}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_version_id": "123e4567-e89b-12d3-a456-426614174000"
}
'{
"run_id": "987fcdeb-51a2-43d1-b456-426614174000",
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"triggered_by": "cron",
"created_at": "2024-01-24T10:30:00Z",
"completed_at": "2023-11-07T05:31:56Z",
"logs": "<string>",
"conversation_id": "<string>",
"conversation_insights_id": "<string>",
"test_suite_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"detail_status": [
{
"name": "<string>",
"status": "pending"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"errors": [
{
"code": "10007",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}