Create agent
Create an agent for a chatbot specified by chatbot uuid
Endpoint
POST api/v1/chatbot/<uuid>/agent/create
Authorization
Authorization string Bearer <your_token>
Path
uuid string required
name string
required
type string
required
One of the following values: user-facing
, background
, human-escalation
, pre-canned
, spam-defense
description string
prompt string
temperature float
meta meta Object
temperature float
Between 0
and 1
Only for user-facing
agents.
bias float
Between 0
and 1
.
Only for user-facing
, human-escalation
, pre-canned
and spam-defense
agents.
stickness float
Between 0
and 1
.
Only for user-facing
, human-escalation
, pre-canned
and spam-defense
agents.
default_message string
Only for pre-canned
and spam-defense
agents.
tags tags Object
Only for background
agents.
use_all_sources boolean
Only for user-facing
agents.
Request example
curl --location --request POST 'https://app.aichatbothub.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.aichatbothub.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.aichatbothub.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);
});
uuid string
name string
prompt string
description string
type string
created_at string
modified_at string
enabled boolean
By default, a newly created agent is disabled
meta meta Object
data_source_uuids List[string]
human_escalation_settings HumanEscalationSettings Object
tool_functions List[ToolFunction]
variables List[AgentVariable]
Response example
{
"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": []
}
Last updated