Create Chabot
In this guide, we will walk through the process of creating a chatbot using API. Each chatbot will automatically have an integrated General QA AI agent, which is essential for its functionality.
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
- Max100
Second 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
That’s it! You’ve now learned how to create your own chatbot using the GPT-trainer API.
Chatbot’s 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
After chatbot creation, a default General QA AI agent is like the one shown in the example response above. You can create additional agents as needed.
Update the agent
After getting the list of agents, you can update the agent by sending a POST request to the following API endpoint:
Please refer to Update Agent API reference and the Agent Properties Reference for detailed information on updating agent’s properties.