Quickstart
Last updated
Was this helpful?
Last updated
Was this helpful?
This quickstart is designed for linux based systems such as Linux distros and Mac. If using windows, Use WSL terminal to follow the quickstart. For installation instruction, refer to .
Docker - Ensure that your system has docker engine installed and running. For installation, please refer to .
The recommended way is to install docker desktop for your system. If using WSL with Windows, Enable docker for you WSL distro. Please refer to for more details.
Docker Compose - Ensure docker compose is enabled along with docker engine. Please refer to .
Tunnel - Tunneling exposes your local system to the services on the web by tunneling the external calls to your local system. Either of these two popular services can be used:
Loophole - Please refer to the for installation.
Ngrok - Please refer to the for installation.
Translation and Speech API - JBManager uses speech processing API to handle audio and translation API to handle user input in various languages. Please refer to Translation and Speech API for more details.
Whatsapp Interface - This quickstart will focus on setup your own through whatsapp as channel. Please refer to for more details.
Clone and Change the directory to the project root.
Copy the contents of .env-dev.template
file to .env-dev
in the same directory.
Update the values of translation and speech fields in the .env-dev
file.
Generate an Encryption key using the following command
and add it to ENCRYPTION_KEY
in .env-dev
file.
Note: Remember to enclose value of ENCRYPTION_KEY
within single quotes.
Create a folder media
in the project root, and start a http server on port 5000 inside the media
directory.
Start a new shell session and start tunnel for port 5000 on your system
For Loophole, use the following command:
For ngrok, use the following command:
Start Kafka and Postgres services using the following command.
Start JB Manager
To start the JB Manager, you can use the following command with or without the --stage
option:
With --stage
option:
When you use the --stage
option, the script will leverage docker-compose
in conjunction with docker-compose.stage.yml
file which uses existing Docker images without rebuilding them, which will save time. This is useful for staging environments where you might want to use different configurations or services compared to the development environment.
Without --stage
option:
When you do not use the --stage
option, the script will build the Docker images from scratch and run docker-compose
with the default docker-compose.yml
file. This is typically used for development environments where you want to ensure that you are working with the latest code changes.
Name [Mandatory] is the name of the bot. It should be same as the name of class defined within below-mentioned bot code (fsm.py). For this example, use CarWashDealerFSM
.
version [Mandatory] - version of the bot. Put 1.0.0
.
required_credentials [Mandatory] - Credentials required by the bot to access various external services. Enter the following: AZURE_OPENAI_API_KEY,AZURE_OPENAI_API_VERSION,AZURE_OPENAI_API_ENDPOINT,FAST_MODEL,SLOW_MODEL
, so put these keys in this section seperated by comma.
Click on Save
button.
Start a new shell session and start tunnel for port 8000 on your system
For Loophole, use the following command:
For ngrok, use the following command:
Add this url to register the callback URL for Whatsapp service provider. Your callback url will look like this <Tunnel URL>/v2/callback/pinnacle_whatsapp/<Whatsapp business account number>
.
For this tutorial, we are using the shell script to add the callback URL using Whatsapp API host. Run the script on a new shell session with the appropriate values to register the callback URL.
Your bot is running. Send a Hi
message to whatsapp business number to start conversation with the bot.
Cannot install loophole on Apple Silicon-based Mac?
Try setting up ngrok with a free tier subscription. Creating a single tunnel does not require any paid plan.
Which OpenAI Model to use?
You can use any model just make sure it supports generating output in JSON mode.
Copy the tunnel url from the shell (loophole example shown below) and add it to PUBLIC_URL_PREFIX
in .env-dev
file.
Once the services are up and running, you can access the JB Manager UI at .
Go to
Click on Add Project and provide the required data to create your bot. The detailed information about the fields are given below:
Code [Mandatory] is the fsm.py file python code. Copy the contents of and paste it.
Once the bot is created, click on the settings (⚙) icon to enter the given credentials values and click save to save the credentials values. For this example, put the values of AZURE_OPENAI_API_KEY
, AZURE_OPENAI_API_VERSION
, AZURE_OPENAI_API_ENDPOINT
, FAST_MODEL
(typically, gpt-3.5-turbo
) and SLOW_MODEL
(typically, gpt-4
). Note: Remember to verify your model names. If you are using Azure OpenAI, this corresponds to Deployment Name and not model type
Then click on the play (▶️) icon to open the Channel Settings Page for the Bot, then click on Add Channel button
Fill in the Channel details and click on save
Toggle on the channel using the toggle switch at right hand side. This makes the channel active. To verify, go to home page by clicking Home
icon on the left Navigation pane and you will see a Pause
button next to the bot
Copy the tunnel url from the shell (loophole example shown below).