curl --location --request POST 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "string",
"type": "string",
"description": "string",
"prompt": "string",
"model": "string",
}'
import requests
url = 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "string",
"type": "user-facing",
"description": "string",
"prompt": "string",
"model": "gpt-4o-mini-4k",
}
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 url = "https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create";
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
const data = {
name: "string",
prompt: "string",
temperature: 0,
model: "gpt-3.5-turbo",
rate_limit: [20, 240],
rate_limit_message: "Too many messages",
show_citations: false,
visibility: "private",
};
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",
"description": "test for creating new agents",
"enabled": 0,
"meta": {
"model": "gpt-4o-mini-4k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "TEST create new agent",
"prompt": "a test user-facing agent",
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": []
}
Agents
Create Agent
Create an agent for a chatbot specified by chatbot uuid
POST
/
api
/
v1
/
chatbot
/
<uuid>
/
agent
/
create
curl --location --request POST 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "string",
"type": "string",
"description": "string",
"prompt": "string",
"model": "string",
}'
import requests
url = 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "string",
"type": "user-facing",
"description": "string",
"prompt": "string",
"model": "gpt-4o-mini-4k",
}
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 url = "https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create";
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
const data = {
name: "string",
prompt: "string",
temperature: 0,
model: "gpt-3.5-turbo",
rate_limit: [20, 240],
rate_limit_message: "Too many messages",
show_citations: false,
visibility: "private",
};
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",
"description": "test for creating new agents",
"enabled": 0,
"meta": {
"model": "gpt-4o-mini-4k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "TEST create new agent",
"prompt": "a test user-facing agent",
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": []
}
Path
string
required
Body
string
required
string
required
One of the following values:
user-facing, background, human-escalation,
pre-canned, spam-defensestring
string
float
meta Object
Show Chatbot meta
Show Chatbot meta
string
user-facing and
background agents.float
Between
Only for
0 and 1Only for
user-facing agents.float
Between
Only for
0 and 1.Only for
user-facing, human-escalation, pre-canned and spam-defense agents.float
Between
Only for
0 and 1.Only for
user-facing, human-escalation, pre-canned and spam-defense agents.string
Only for
pre-canned and spam-defense agents.tags Object
Only for
background agents.boolean
Only for
user-facing agents.Response
string
string
string
string
string
string
string
boolean
By default, a newly created agent is disabled
meta Object
List[string]
HumanEscalationSettings Object
List[ToolFunction]
List[AgentVariable]
curl --location --request POST 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "string",
"type": "string",
"description": "string",
"prompt": "string",
"model": "string",
}'
import requests
url = 'https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>'
}
data = {
"name": "string",
"type": "user-facing",
"description": "string",
"prompt": "string",
"model": "gpt-4o-mini-4k",
}
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 url = "https://app.gpt-trainer.com/api/v1/chatbot/{uuid}/agent/create";
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer <token>",
};
const data = {
name: "string",
prompt: "string",
temperature: 0,
model: "gpt-3.5-turbo",
rate_limit: [20, 240],
rate_limit_message: "Too many messages",
show_citations: false,
visibility: "private",
};
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",
"description": "test for creating new agents",
"enabled": 0,
"meta": {
"model": "gpt-4o-mini-4k",
"tags": [],
"temperature": 0.0
},
"modified_at": "2024-07-25T21:19:01Z",
"name": "TEST create new agent",
"prompt": "a test user-facing agent",
"type": "user-facing",
"uuid": "43474da7ae3b4b7191ee29c2de798257",
"variables": []
}
⌘I