Code Pack - rachelchat

AI Language Teaching Chatbot Built with ChatGPT and ElevenLabs

Learn any language or have your chatbot perform special speaking tasks with humour

Technologies
ai
chatgpt
elevenlabs
Themes
arbitrage
crypto
trading
flashloans
Skill Level
intermediate
Last updated
2023-03-06

What's Inside

How would you like to have a voice conversation in any language of your choice?

See the preview of the tool in action here:

https://youtu.be/CWaaNNrSiLQ.

This is now possible with AI. ChatGPT and ElevenLabs technology together is extremely powerful. We can now create chatbots that speak in a very human sounding voice and could perform the following:

- Chat with potential customers and encourage new leads
  • Teach you Spanish, Chinese, French, English or any language of your choosing
- Talk to you about the world and everything in it

This is truly an exciting time to be a developer with a significant amount of technology that when combined packs a powerful punch.

Uses

-
Modify your chatbot for any purpose or task
-
Make your chatbot speak in your own voice
-
Make your chatbot speak in anyone else's voice
-
Your chatbot will be able to answer extremely complex questions in any language

Requirements

-
You must have some basic Python coding experience and also some basic knowledge of how React works
-
To launch this bot in the cloud, you will need experience in deploying websites

START

What you need to get running

Below is the basic software you will need to get started:

Node(developed with version: 18.11.0)
ts-node(developed with version: 10.9.1)
Yarn(developed with version: 1.22.19)
python(Developed with Python version 3.7)

Step 1

Download package

Click the download button at the top of this page. Then save the project on your desktop of project folder. Going forward, we will assume a project name as 'myproject'.
However, you may of course name the project folder whatever makes sense for your purpose.

Step 2

Setup backend

Change directory into backend

cd chatbot/backend

SETUP VIRTUAL ENVIRONMENT

Create a Virtual Environment

python3 -m venv venv
Activate Virtual Environment (MAC)

source venv/bin/activate
Activate Virtual Environment (Windows)

source venv/Scripts/activate
Upgrade PIP

pip3 install --upgrade pip

INSTALL PYTHON PACKAGES

Install required Python packages

pip3 install openai python-decouple fastapi "uvicorn[standard]" python-multipart

Or use this alternative method (although this alternative method might not work if using Windows)

pip3 install -r requirements.txt

CREATE ENVIRONMENT VARIABLES

Create your .env file

touch .env
Get your keys from the below sources:

For ElevenLabs, just click on your profile picture to get the key once logged in:

Update your .env file with the following. You can see your .env by typing sudo nano .env or just by clicking on the file if you are in VS Code.

OPEN_AI_ORG=enter-you-key-here
OPEN_AI_KEY=enter-you-key-here
ELEVEN_LABS_API_KEY=enter-you-key-here
Start your backend server

uvicorn main:app

Alternatively, you can ensure your server resets every time you make a change by typing:

uvicorn main:app --reload

You can check your server is working by going to Chrome and entering:

Step 3

Setup frontend

Change directory into frontend

cd ..
cd chatbot/frontend
Install packages

yarn --exact
Build application

yarn build
Start server in dev mode

yarn dev

You can check your dev server is working by going to by going to Chrome and entering: http://localhost:5173/health

or alternatively in live mode:

yarn start

You can check your live server is working by going to Chrome and entering:

http://localhost:4173/health

CONGRATULATIONS

You are now ready to learn Spanish

Your bot is ready and you can now test it out using Google Chrome