/Web-based-Chatbot

Build your own intelligent chatbot effortlessly with this customizable, open-source framework.

Primary LanguageHTMLMIT LicenseMIT

Web-based-Chatbot

This open-source framework is designed to help you build your own intelligent chatbot quickly and easily. With a robust backend powered by Google Generative AI and a user-friendly frontend interface, this framework allows you to customize and deploy a chatbot tailored to your specific needs. Whether you're building a customer support bot, a virtual assistant, or an educational companion, this framework provides the tools and flexibility you need to bring your chatbot to life. Dive into the world of conversational AI and create engaging, responsive chat experiences effortlessly. There two files in the package, one is app.py which supports the backend and the other one is index.html which is responsible for the fronend display of the chats. The backend framework uses flask for communication with the frontend web app via the JSON script in the index.html.

Customizations

-> If you tried running directly the app.py and opening index.html, then you would have noticed some weired things such as 'YOU_BOT_NAME - Line 189' and '<INITIAL_TEXT - Line 192>'.
-> So here there are certin things you need to replace before starting to use it, follow the bellow steps to make it a ready to use bot.

Step 1: Go to line 12 in app.py replace 'YOUR_BOT_NAME' with your bot.s name.
Step 2: Go to line 28 in app.py and replace '<INSER_HERE>' with the context based on with you want your conversation should start.
Step 3: Go to line 189 in index.html and replace 'YOUR_BOT_NAME' with with your bot's name.
Step 4: Go to Line 192 in index.html and replace '<INITIAL_TEXT>' with the introductory text with you want the bot to show at the initiation of the web app chat.
Step 5: Most important part if you skip your bot would'nt work, adding the API key, so as you have understood This chatbot is built.

GO to aistudio.google.com and then generate a key image
You might have to create a project for getting an API key, you can create a project by going to cloud.google.com
Once you have the API key, go-a-head grab it.
Step 6: After copying the API key, run 'python3 API_KEY.py' just paste the API Key when it asks you. Now, you are ready to rock.

After doing the above you can go a head to install the dependencies and perform the usage of the web based chatbot you just created.

Installation and usage

  1. Install requirments.txt
   pip install requirments.txt
  1. Copy the API key and run this
   python3 API_KEY.py
  1. Run the app.py file
     python app.py
  1. Open index.html in a browser

  2. Start communication

GOOD LUCK!!!