Skip to main content

Compute new clusters

POST 
/ai/clusters

Starts a background task to compute how the data in an embedded storage bucket is clustered. This helps identify common themes and patterns in the data.

Request

Body

required

    bucket stringrequired

    The embedded storage bucket to compute the clusters from. The bucket must already be embedded.

    prefix string

    Prefix to filter whcih files in the buckets are included.

    files string[]

    Array of files to filter which are included.

    min_cluster_size integer

    Default value: 25

    Smallest number of related text chunks to qualify as a cluster. Top-level clusters should be thought of as identifying broad themes in your data.

    min_subcluster_size integer

    Default value: 5

    Smallest number of related text chunks to qualify as a sub-cluster. Sub-clusters should be thought of as identifying more specific topics within a broader theme.

Responses

200: Successful Response

422: Validation Error

Request samples


curl -L 'https://api.telnyx.com/v2/ai/clusters' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"bucket": "string",
"prefix": "string",
"files": [
"string"
],
"min_cluster_size": 25,
"min_subcluster_size": 5
}'

Response samples


{
"data": {
"task_id": "string"
}
}