AI Chatbot Hub
HomepageAPI docsDiscordLog inSign up
API docs
API docs
  • API usage guides
    • Getting an API key
    • Create a chatbot
    • Chat with chatbot
    • Uploading data sources
  • Chatbots
    • Chatbot properties
    • Create chatbot
    • Update chatbot
    • Fetch a chatbot
    • Fetch all chatbots
    • Delete chatbot
  • Agents
    • Agent properties
    • Create agent
    • Update agent
    • Fetch all agents
    • Delete agent
  • Chatbot sessions
    • Session properties
    • Create session
    • Fetch a session
    • Fetch all sessions
    • Delete session
  • Session messages
    • Message properties
    • Create message
    • Fetch all messages
    • Delete message
    • Delete multiple messages
  • Data sources
    • Source properties
    • Upload a file
    • Create QA source
    • Create URL source
    • Update source
    • Fetch list of sources
    • Retrain sources
    • Delete source
    • Delete multiple sources
  • Data source tags
    • Create source tag
    • Fetch all source tags
    • Update source tag
    • Delete source tag
Powered by GitBook
On this page
  • Endpoint
  • Authorization
  • Path
  • ​Body
  • Request example
  • ​Response
  • Response example
  1. Agents

Create agent

Create an agent for a chatbot specified by chatbot uuid

PreviousAgent propertiesNextUpdate agent

Last updated 6 months ago

Endpoint

POST api/v1/chatbot/<uuid>/agent/create

Authorization

Authorization string Bearer <your_token>

Path

uuid string required

Body

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

  • model string

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": []
}

Response

​
​