BoostGPT Docs
HomePricingPlayground
  • Overview
  • Quick Start
  • Playground
  • Official Libraries
    • Node.js
  • API
  • Integrations
    • Crisp
    • Discord
    • Slack
    • Telegram
    • WhatsApp
  • Use cases
    • Personal assistants
    • Customer service chatbot
    • Content creation
    • Real estate
    • HR and recruitment
    • E-commerce
    • Education
      • Deploying an Educational Chatbot with API
  • Changelog
Powered by GitBook
On this page
  • Get your API Key
  • Create your first chatbot
  • Train your chatbot
  • Engage your chatbot
  • Questions?

Was this helpful?

Quick Start

Train and engage your first chatbot.

PreviousOverviewNextPlayground

Last updated 1 year ago

Was this helpful?

Start by creating a project in BoostGPT, which will provide you with a dedicated workspace for each of your applications. Within each project, you can create and train multiple chatbots.

To begin, create your initial project and copy its ID. Go to the project settings to copy your project ID or go here: .

For illustration purposes, let's say you created a project which has the ID: "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3".

Get your API Key

API requests require authentication via API keys. If an API key is not included in a request, an error message will be returned. To generate a new API key, go to the API keys page which can be found in your account settings, and create a new API key or go here: . Make sure to copy the API key once it's generated.

Create your first chatbot

You're all set to create your first chatbot on BoostGPT. To do so, send a POST request to the "create bot" endpoint. Once the chatbot has been successfully created, it will be visible on your BoostGPT dashboard.

curl --location 'http://api.boostgpt.co/v1/bot/create' \
--header 'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3' \
--data '{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "name": "Example name",
    "model": "gpt-3.5-turbo",
    "instruction": "I want you to act as an AI assistant that I am having a conversation with. Your name is '\''AI Assistant'\'' and you always formats your responses in Markdown. You will provide me with answers from the given context. If the answer is not included, say exactly '\''Hmm, I am not sure.'\'' and stop after that. Refuse to answer any question not about the info. Never break character.",
    "status": 1
}'

npm install boostgpt

const { BoostGPT } = require("boostgpt")

const boostgpt = new BoostGPT({
    key: "YOUR API KEY",
    project_id: "YOUR PROJECT ID"
});
let payload = {
    name: "Example name",
    model: "gpt-3.5-turbo", //Require any of : text-davinci-002, text-davinci-003, gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-4
    instruction: `I want you to act as an AI assistant that I am having a conversation with. Your name is 'AI Assistant' and you always formats your responses in Markdown. You will provide me with answers from the given context. If the answer is not included, say exactly 'Hmm, I am not sure.' and stop after that. Refuse to answer any question not about the info. Never break character.`,//Optional. An instreuction to prompt the chatbot on how to respond
    status: 1 //Require any string of [ "1" or "0"]. Status 1 = online, Status 0 = offline
}
let chatbot = await boostgpt.createBot(payload);

if (chatbot.err) {
   //Handle errors here.
}else{
   console.log(chatbot.response);
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://api.boostgpt.co/v1/bot/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "name": "Example name",
    "model": "gpt-3.5-turbo",
    "instruction": "I want you to act as an AI assistant that I am having a conversation with. Your name is \'AI Assistant\' and you always formats your responses in Markdown. You will provide me with answers from the given context. If the answer is not included, say exactly \'Hmm, I am not sure.\' and stop after that. Refuse to answer any question not about the info. Never break character.",
    "status": 1
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

This will output a response that looks like this.

{
    "bot": {
        "uuid": "fa155610-e2a2-11ed-8d7e-128759b35991",
        "name": "Example name",
        "model": "gpt-3.5-turbo",
        "max_reply_tokens": "300",
        "instruction": "I want you to act as an AI assistant that I am having a conversation with. Your name is 'AI Assistant' and you always formats your responses in Markdown. You will provide me with answers from the given context. If the answer is not included, say exactly 'Hmm, I am not sure.' and stop after that. Refuse to answer any question not about the info. Never break character.",
        "status": 1,
        "updated_at": "2023-04-24T13:21:52.000Z"
    }
}

Train your chatbot

In the following steps, we'll show you how to include training data in your chatbot. By following these instructions, you'll learn how to improve the accuracy and quality of your chatbot's responses by providing it with additional context and information.

curl --location 'http://api.boostgpt.co/v1/bot/source/create' \
--header 'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3' \
--data '{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "bot_id": "8e9124a2-e0a3-11ed-b5a3-33d8a09a24e3",
    "tags": [],
    "type": "text",
    "source": "YOUR SOURCE DATA"
}'

npm install boostgpt

const { BoostGPT } = require("boostgpt")

const boostgpt = new BoostGPT({
    key: "YOUR API KEY",
    project_id: "YOUR PROJECT ID"
});
let payload = {
    bot_id: "fa155610-e2a2-11ed-8d7e-128759b35991"
    tags: [], //Use tags to segment your training data
    type: 'text', //Require any of : text, file, webpage, website
    source: 'YOUR SOURCE DATA'//Require your text content or an accessible link to your file, webpage, or website
}
let chatbot = await boostgpt.startTraining(payload);

if (chatbot.err) {
   //Handle errors here.
}else{
   console.log(chatbot.response);
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://api.boostgpt.co/v1/bot/source/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "bot_id": "8e9124a2-e0a3-11ed-b5a3-33d8a09a24e3",
    "tags": [],
    "type": "text",
    "source": "YOUR SOURCE DATA"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

This will output a response that looks like this.

{
    "source": {
        "uuid": "1f2fbbd2-e436-11ed-ad91-a2ce1f33a089",
        "source": "",
        "type": "text",
        "links_crawled": [],
        "links_crawled_count": "0",
        "tags": [],
        "tokens": 199
    }
}

Engage your chatbot

curl --location 'http://api.boostgpt.co/v1/bot/chat' \
--header 'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3' \
--data '{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "bot_id": "8e9124a2-e0a3-11ed-b5a3-33d8a09a24e3",
    "openai_key": "YOUR-OPENAI-APIKEY",
    "model": "gpt-3.5-turbo",
    "message":"USER MESSAGE",
    "source_ids": ["832146d2-e43c-11ed-ad91-a2ce1f33a089"],
    "tags": ["twitter"],
    "top":15,
    "instruction": "",
    "max_reply_tokens": 300,
    "chat_id": "example-chat-id",
    "stream": false
}'

npm install boostgpt

const { BoostGPT } = require("boostgpt")

const boostgpt = new BoostGPT({
    key: "YOUR API KEY",
    project_id: "YOUR PROJECT ID"
});
let payload = {
    bot_id: "8e9124a2-e0a3-11ed-b5a3-33d8a09a24e3",//The collection to chat
    model: "gpt-3.5-turbo", //The model to use for the chat response. Defaults to the bot model.
    message: "USER MESSAGE", //The chat message
    source_ids: ["c26b16b4-d394-11ed-b5a3-33d8a09a24e3"], //The training source id's you want the AI's knowledge to be limited to.
    tags: ["twitter"], //Use tags to get the segment of the training data you want the AI's knowledge to be limited to.
    top: 10, //Optional. The weight of training data used to form a context. Defaults to 10. Recommended settings between : 10 - 15 give better response from the AI.
    max_reply_tokens: 300, // Optional. The maximum number of tokens allowed for the chat response. By default, the number of tokens the model can return will be (300 - tokens).
    instruction: "" //Optional. An instruction to tell the AI how to reply. Defaults to the bot instruction.
    "chat_id": "example-chat-id",
    "stream": false
}

let chatbot = await boostgpt.chatBot(payload);

if (chatbot.err) {
   //Handle errors here.
}else{
   console.log(chatbot.response);
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://api.boostgpt.co/v1/bot/chat',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "project_id": "13c8cc4a-ddef-11ed-b5a3-33d8a09a24e3",
    "bot_id": "8e9124a2-e0a3-11ed-b5a3-33d8a09a24e3",
    "model": "gpt-3.5-turbo",
    "message":"USER MESSAGE",
    "source_ids": ["832146d2-e43c-11ed-ad91-a2ce1f33a089"],
    "tags": ["twitter"],
    "top":15,
    "instruction": "",
    "max_reply_tokens": 300,
    "chat_id": "example-chat-id",
    "stream": false
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer 8a79d8c2-e018-11ed-b5a3-33d8a09a24e3'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

A sample of how the response looks is shown below.

{
    "chat": {
        "reply": "BOT REPLY",
        "meta": [
            {
                "source_id": "832146d2-e43c-11ed-ad91-a2ce1f33a089",
                "tags": [
                    "twitter",
                    "revue"
                ]
            }
        ],
        "usage": {
            "prompt_tokens": 380,
            "completion_tokens": 82,
            "total_tokens": 462
        }
    }
}

Questions?

In the example provided below, we demonstrate how you can engage with a chatbot that has been trained using your specific data. This will enable you to witness how the chatbot performs in terms of providing appropriate and accurate responses based on the training data you've provided. You will need an to chat with a bot.

https://app.boostgpt.co/settings
https://app.boostgpt.co/account/api-keys
Openai key
Join our Discord server.