Fetch a cluster
Fetch the results of a clustering task, including the discovered clusters.
GET
/
ai
/
clusters
/
{task_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 cluster = await client.ai.clusters.retrieve('task_id');
console.log(cluster.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
cluster = client.ai.clusters.retrieve(
task_id="task_id",
)
print(cluster.data)
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"),
)
cluster, err := client.AI.Clusters.Get(
context.TODO(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cluster.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.clusters.ClusterRetrieveParams;
import com.telnyx.sdk.models.ai.clusters.ClusterRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ClusterRetrieveResponse cluster = client.ai().clusters().retrieve("task_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
cluster = telnyx.ai.clusters.retrieve("task_id")
puts(cluster)<?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 {
$cluster = $client->ai->clusters->retrieve(
'task_id', showSubclusters: true, topNNodes: 0
);
var_dump($cluster);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:clusters retrieve \
--api-key 'My API Key' \
--task-id task_idcurl --request GET \
--url https://api.telnyx.com/v2/ai/clusters/{task_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"status": "pending",
"bucket": "string",
"clusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [],
"total_number_of_nodes": 0,
"subclusters": []
}
]
}
]
}
]
}
]
}
]
}
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}Authorizations
Query Parameters
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 cluster = await client.ai.clusters.retrieve('task_id');
console.log(cluster.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
cluster = client.ai.clusters.retrieve(
task_id="task_id",
)
print(cluster.data)
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"),
)
cluster, err := client.AI.Clusters.Get(
context.TODO(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cluster.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.clusters.ClusterRetrieveParams;
import com.telnyx.sdk.models.ai.clusters.ClusterRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ClusterRetrieveResponse cluster = client.ai().clusters().retrieve("task_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
cluster = telnyx.ai.clusters.retrieve("task_id")
puts(cluster)<?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 {
$cluster = $client->ai->clusters->retrieve(
'task_id', showSubclusters: true, topNNodes: 0
);
var_dump($cluster);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:clusters retrieve \
--api-key 'My API Key' \
--task-id task_idcurl --request GET \
--url https://api.telnyx.com/v2/ai/clusters/{task_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"status": "pending",
"bucket": "string",
"clusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [
{
"filename": "string",
"text": "string"
}
],
"total_number_of_nodes": 0,
"subclusters": [
{
"cluster_id": "string",
"cluster_header": "string",
"cluster_summary": "string",
"nodes": [],
"total_number_of_nodes": 0,
"subclusters": []
}
]
}
]
}
]
}
]
}
]
}
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}