curl --location --request POST 'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}'
import requests
uuid = '<agent-uuid>'
url = f'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Request successful!")
print(response.json())
else:
print("Request failed with status code:", response.status_code)
print(response.text)
const axios = require("axios");
const uuid = "<agent-uuid>";
const url = `https://app.gpt-trainer.com/api/v1/agent/${uuid}/update`;
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
data = {
name: "Test update agent name",
description: "Test update agent description",
prompt: "Test update agent prompt",
model: "gpt-4o-mini-16k",
enabled: true,
variables: [
{
description: "Email of the user.",
example: "alice@company.com, ben@school.edu, carl@city.org",
type: "string",
default_value: { content: "", static: 0 },
name: "user_email",
},
{
description:
"Full name of the user, in the format of [First name] [Last name]",
example: "",
type: "string",
default_value: { content: "", static: 0 },
name: "user_name",
},
],
};
axios
.post(url, data, { headers })
.then((response) => {
console.log("Request successful!");
console.log(response.data);
})
.catch((error) => {
console.error("Request failed:", error);
});
{
"created_at": "2024-07-25T21:19:01Z",
"data_source_uuids": [],
"description": "Test update agent description",
"enabled": true,
"meta": {
"model": "gpt-4o-mini-16k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "Test update agent name",
"prompt": "Test update agent prompt",
"tool_functions": [],
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": [
{
"default_value": {
"content": "",
"static": 0
},
"description": "Email of the user.",
"example": "alice@company.com, ben@school.edu, carl@city.org",
"name": "user_email",
"type": "string"
},
{
"default_value": {
"content": "",
"static": 0
},
"description": "Full name of the user, in the format of [First name] [Last name]",
"example": "",
"name": "user_name",
"type": "string"
}
]
}
Agents
Update Agent
Update agent meta based on agent uuid
POST
/
api
/
v1
/
agent
/
{uuid}
/
update
curl --location --request POST 'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}'
import requests
uuid = '<agent-uuid>'
url = f'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Request successful!")
print(response.json())
else:
print("Request failed with status code:", response.status_code)
print(response.text)
const axios = require("axios");
const uuid = "<agent-uuid>";
const url = `https://app.gpt-trainer.com/api/v1/agent/${uuid}/update`;
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
data = {
name: "Test update agent name",
description: "Test update agent description",
prompt: "Test update agent prompt",
model: "gpt-4o-mini-16k",
enabled: true,
variables: [
{
description: "Email of the user.",
example: "alice@company.com, ben@school.edu, carl@city.org",
type: "string",
default_value: { content: "", static: 0 },
name: "user_email",
},
{
description:
"Full name of the user, in the format of [First name] [Last name]",
example: "",
type: "string",
default_value: { content: "", static: 0 },
name: "user_name",
},
],
};
axios
.post(url, data, { headers })
.then((response) => {
console.log("Request successful!");
console.log(response.data);
})
.catch((error) => {
console.error("Request failed:", error);
});
{
"created_at": "2024-07-25T21:19:01Z",
"data_source_uuids": [],
"description": "Test update agent description",
"enabled": true,
"meta": {
"model": "gpt-4o-mini-16k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "Test update agent name",
"prompt": "Test update agent prompt",
"tool_functions": [],
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": [
{
"default_value": {
"content": "",
"static": 0
},
"description": "Email of the user.",
"example": "alice@company.com, ben@school.edu, carl@city.org",
"name": "user_email",
"type": "string"
},
{
"default_value": {
"content": "",
"static": 0
},
"description": "Full name of the user, in the format of [First name] [Last name]",
"example": "",
"name": "user_name",
"type": "string"
}
]
}
Path
Agent uuid
Body
Response
curl --location --request POST 'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}'
import requests
uuid = '<agent-uuid>'
url = f'https://app.gpt-trainer.com/api/v1/agent/{uuid}/update'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "Test update agent name",
"description": "Test update agent description",
"prompt": "Test update agent prompt",
"model": "gpt-4o-mini-16k",
"enabled": true,
"variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Request successful!")
print(response.json())
else:
print("Request failed with status code:", response.status_code)
print(response.text)
const axios = require("axios");
const uuid = "<agent-uuid>";
const url = `https://app.gpt-trainer.com/api/v1/agent/${uuid}/update`;
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
data = {
name: "Test update agent name",
description: "Test update agent description",
prompt: "Test update agent prompt",
model: "gpt-4o-mini-16k",
enabled: true,
variables: [
{
description: "Email of the user.",
example: "alice@company.com, ben@school.edu, carl@city.org",
type: "string",
default_value: { content: "", static: 0 },
name: "user_email",
},
{
description:
"Full name of the user, in the format of [First name] [Last name]",
example: "",
type: "string",
default_value: { content: "", static: 0 },
name: "user_name",
},
],
};
axios
.post(url, data, { headers })
.then((response) => {
console.log("Request successful!");
console.log(response.data);
})
.catch((error) => {
console.error("Request failed:", error);
});
{
"created_at": "2024-07-25T21:19:01Z",
"data_source_uuids": [],
"description": "Test update agent description",
"enabled": true,
"meta": {
"model": "gpt-4o-mini-16k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "Test update agent name",
"prompt": "Test update agent prompt",
"tool_functions": [],
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": [
{
"default_value": {
"content": "",
"static": 0
},
"description": "Email of the user.",
"example": "alice@company.com, ben@school.edu, carl@city.org",
"name": "user_email",
"type": "string"
},
{
"default_value": {
"content": "",
"static": 0
},
"description": "Full name of the user, in the format of [First name] [Last name]",
"example": "",
"name": "user_name",
"type": "string"
}
]
}
⌘I