Quickstart
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 WSL Installation Guide.
Prerequisite
Docker - Ensure that your system has docker engine installed and running. For installation, please refer to docker engine installation instruction.
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 docker desktop installation for more details.
Docker Compose - Ensure docker compose is enabled along with docker engine. Please refer to docker compose installation instruction.
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 Loophole Quickstart Guide for installation.
Ngrok - Please refer to the Ngrok Quickstart Guide 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 setup guide for more details.
Whatsapp Interface - This quickstart will focus on setup your own through whatsapp as channel. Please refer to channel setup guide for more details.
Running JB Manager
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 themedia
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 leveragedocker-compose
in conjunction withdocker-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 rundocker-compose
with the defaultdocker-compose.yml
file. This is typically used for development environments where you want to ensure that you are working with the latest code changes.
Once the services are up and running, you can access the JB Manager UI at http://localhost:4173.
Bot Installation and Go Live
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
.Code [Mandatory] is the fsm.py file python code. Copy the contents of python file and paste it.
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.
Quickstart FAQs
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.
Last updated