Prerequisites
Before you begin, make sure you have the following:- An API key for accessing the GPT-trainer API.
- A development environment or tool for making HTTP requests, such as Curl or a programming language like Python.
Create the chatbot and General QA AI agent
API Endpoint
The API endpoint for creating a chatbot is:Request Body
To create a chatbot, you need to send a POST request to the API endpoint with a JSON request body. Here’s an example request body:- name (string, required): Provide a name for your chatbot.
-
rate_limit (array, optional): Set the rate limit for the chatbot in messages per minute. It’s an array with two values: [20, 240].
First number: amount of messages. Min
1- Max100Second number: amount of seconds. Min1- Max360 - rate_limit_message (string, optional): Define a message to display when the rate limit is exceeded.
- show_citations (boolean, optional): Set to true if you want the chatbot to show citations for its responses.
-
visibility (string, optional): Set the visibility of your chatbot. Options are “private” or “public.”
Options available
private,public,hybrid
Example Request
Here’re example command sto create a chatbot using the GPT-trainer API:Example Response
Response
uuid will be used in following guides.
Note: After creating the chatbot, a default General QA AI agent will be
automatically created and used to handle the user’s queries. You can configure
this agent by following the guides below.
Confiure the General QA AI agent
Get the list of agents
Use the following API endpoint to get the list of agents for a chatbot:Example Response
Response
Update the agent
After getting the list of agents, you can update the agent by sending a POST request to the following API endpoint:Example Request
Example Response
Response