Partially updates the collection’s retrieval settings.
PATCH
/
ai
/
collections
/
{uuid}
/
settings
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.collections.settings.patchAll('uuid', {
retrieval: 'retrieval',
});
console.log(response.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
)
response = client.ai.collections.settings.patch_all(
uuid="uuid",
retrieval="retrieval",
)
print(response.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"),
)
response, err := client.AI.Collections.Settings.PatchAll(
context.TODO(),
"uuid",
telnyx.AICollectionSettingPatchAllParams{
Retrieval: telnyx.String("retrieval"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.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.collections.settings.SettingPatchAllParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SettingPatchAllParams params = SettingPatchAllParams.builder()
.retrieval("retrieval")
.build();
var response = client.ai().collections().settings().patchAll("uuid", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.collections.settings.patch_all("uuid", retrieval: "retrieval")
puts(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 {
$response = $client->ai->collections->settings->patchAll(
'uuid',
retrieval: 'retrieval',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:collections:settings patch-all \
--api-key 'My API Key' \
--uuid 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e \
--retrieval retrievalcurl --request PATCH \
--url https://api.telnyx.com/v2/ai/collections/{uuid}/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retrieval": {
"top_k": 5,
"retrieval_type": "vector"
}
}
'{
"data": {
"record_type": "ai_collection_settings",
"retrieval": {
"top_k": 5,
"retrieval_type": "vector"
}
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The request failed because it was not well-formed.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "collection_not_found",
"title": "Collection not found",
"detail": "No collection with uuid 'b3b1c8a2-9f4e-4d2a-9c1e-2f7a6d5b4c3a' exists for this account."
}
]
}{
"errors": [
{
"code": "unsupported_retrieval_type",
"title": "Unsupported retrieval type",
"detail": "retrieval_type 'semantic' is not supported. Supported types: 'hybrid', 'vector'.",
"meta": {
"pointer": "/retrieval/retrieval_type"
}
}
]
}Authorizations
Telnyx API key. Collections and results are automatically scoped to the authenticated user's organization.
Path Parameters
The collection's unique identifier.
Example:
"6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e"
Body
application/json
How documents are retrieved when searching the collection.
Show child attributes
Show child attributes
Response
The updated settings.
Show child attributes
Show child attributes
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 response = await client.ai.collections.settings.patchAll('uuid', {
retrieval: 'retrieval',
});
console.log(response.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
)
response = client.ai.collections.settings.patch_all(
uuid="uuid",
retrieval="retrieval",
)
print(response.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"),
)
response, err := client.AI.Collections.Settings.PatchAll(
context.TODO(),
"uuid",
telnyx.AICollectionSettingPatchAllParams{
Retrieval: telnyx.String("retrieval"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.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.collections.settings.SettingPatchAllParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SettingPatchAllParams params = SettingPatchAllParams.builder()
.retrieval("retrieval")
.build();
var response = client.ai().collections().settings().patchAll("uuid", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.collections.settings.patch_all("uuid", retrieval: "retrieval")
puts(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 {
$response = $client->ai->collections->settings->patchAll(
'uuid',
retrieval: 'retrieval',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:collections:settings patch-all \
--api-key 'My API Key' \
--uuid 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e \
--retrieval retrievalcurl --request PATCH \
--url https://api.telnyx.com/v2/ai/collections/{uuid}/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retrieval": {
"top_k": 5,
"retrieval_type": "vector"
}
}
'{
"data": {
"record_type": "ai_collection_settings",
"retrieval": {
"top_k": 5,
"retrieval_type": "vector"
}
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The request failed because it was not well-formed.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "collection_not_found",
"title": "Collection not found",
"detail": "No collection with uuid 'b3b1c8a2-9f4e-4d2a-9c1e-2f7a6d5b4c3a' exists for this account."
}
]
}{
"errors": [
{
"code": "unsupported_retrieval_type",
"title": "Unsupported retrieval type",
"detail": "retrieval_type 'semantic' is not supported. Supported types: 'hybrid', 'vector'.",
"meta": {
"pointer": "/retrieval/retrieval_type"
}
}
]
}