Replace an instruction in an agent
curl --request PATCH \
--url https://api.tess.im/agents/{id}/instructions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"revision": "<string>",
"old_text": "<string>",
"new_text": "<string>"
}
'import requests
url = "https://api.tess.im/agents/{id}/instructions"
payload = {
"revision": "<string>",
"old_text": "<string>",
"new_text": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: '<string>', old_text: '<string>', new_text: '<string>'})
};
fetch('https://api.tess.im/agents/{id}/instructions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/agents/{id}/instructions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'revision' => '<string>',
'old_text' => '<string>',
'new_text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/agents/{id}/instructions"
payload := strings.NewReader("{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tess.im/agents/{id}/instructions")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/agents/{id}/instructions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAgents
Replace an instruction in an agent
Replace a single exact passage while preserving the rest of the prompt.
PATCH
/
agents
/
{id}
/
instructions
Replace an instruction in an agent
curl --request PATCH \
--url https://api.tess.im/agents/{id}/instructions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"revision": "<string>",
"old_text": "<string>",
"new_text": "<string>"
}
'import requests
url = "https://api.tess.im/agents/{id}/instructions"
payload = {
"revision": "<string>",
"old_text": "<string>",
"new_text": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: '<string>', old_text: '<string>', new_text: '<string>'})
};
fetch('https://api.tess.im/agents/{id}/instructions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/agents/{id}/instructions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'revision' => '<string>',
'old_text' => '<string>',
'new_text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/agents/{id}/instructions"
payload := strings.NewReader("{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tess.im/agents/{id}/instructions")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/agents/{id}/instructions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": \"<string>\",\n \"old_text\": \"<string>\",\n \"new_text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body
Send the revision returned by the read, the exact passage as
old_text and the replacement as new_text. Send an empty new_text to remove the passage. The server returns HTTP 409 if the prompt changed or the passage does not occur exactly once.
Use this operation for corrections or removals. Use append_to_prompt in Update an agent when the request is to add a new instruction.
