Enhance Assistant Instructions
Enhance an assistant’s instructions using an LLM. The endpoint reads the assistant’s current instructions and tools, then streams back improved instructions as they are generated.
Optionally provide an enhancement_prompt to steer the changes (for example, “make the instructions more concise” or “add error handling guidance”). When omitted, the assistant’s existing instructions are used as the basis for the enhancement.
The enhancement focuses on tool-calling reliability, clarity and precision, completeness and error handling, tool schema alignment, and conversation flow structure.
The response is streamed as text/plain using chunked transfer encoding; consume the body incrementally to render the enhanced instructions as they arrive.
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.assistants.instructions.enhance('assistant_id');
console.log(response);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.assistants.instructions.enhance(
assistant_id="assistant_id",
)
print(response)
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.Assistants.Instructions.Enhance(
context.TODO(),
"assistant_id",
telnyx.AIAssistantInstructionEnhanceParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
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.instructions.InstructionEnhanceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
String response = client.ai().assistants().instructions().enhance("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.assistants.instructions.enhance("assistant_id")
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->assistants->instructions->enhance(
'assistant_id',
enhancementPrompt: 'enhancement_prompt',
instructions: 'instructions',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:instructions enhance \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id}/instructions/enhance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enhancement_prompt": "string",
"instructions": "string"
}
'Enhanced Instructions Stream{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the assistant.
Body
Optional guidance describing how the instructions should be enhanced. When provided, the LLM applies these requested changes in addition to fixing any identified issues.
The instructions to enhance. When omitted, the assistant's existing instructions are used.
Response
A stream of enhanced instruction text. The body is sent as text/plain using chunked transfer encoding.
The response is of type string.
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 response = await client.ai.assistants.instructions.enhance('assistant_id');
console.log(response);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.assistants.instructions.enhance(
assistant_id="assistant_id",
)
print(response)
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.Assistants.Instructions.Enhance(
context.TODO(),
"assistant_id",
telnyx.AIAssistantInstructionEnhanceParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
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.instructions.InstructionEnhanceParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
String response = client.ai().assistants().instructions().enhance("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.assistants.instructions.enhance("assistant_id")
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->assistants->instructions->enhance(
'assistant_id',
enhancementPrompt: 'enhancement_prompt',
instructions: 'instructions',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:instructions enhance \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id}/instructions/enhance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enhancement_prompt": "string",
"instructions": "string"
}
'Enhanced Instructions Stream{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}