Skip to content

Latest commit

 

History

History
131 lines (82 loc) · 3.44 KB

README.md

File metadata and controls

131 lines (82 loc) · 3.44 KB

Vodafone-Chatbot with open-source models

Project Overview

visual app

final prompt

Vodafone Chatbot is a managerial-level simulation designed to streamline Vodafone database interactions using Large Language Models (LLMs) and LangChain. This project leverages MySQL for data storage and retrieval and utilizes LLMs to generate SQL queries based on user questions. The resulting data is then processed and, if it represents a time series, visualized using graphs to facilitate easy interpretation.

Project pipeline with langchain and LLM

Download Test Database chinook

First of all, download the Chinook database. This is a sample database that represents a digital media store, including tables for artists, albums, media tracks, invoices, and customers. We will use this database to test our chatbot.

Install MySQL

  1. Download MySQL From Ofiicial site
  2. Also you cloud download MySQL Workbench From here

Connect chinook Database

  1. Go to your terminal and log in to MySQL using the following command:
$ mysql -u root -p
  1. You will be prompted to enter your password. Once you are logged in, you can create a new database using the following commands:
$ CREATE DATABASE chinook;
$ USE chinook;
$ SOURCE chinook.sql;

Requirements

  • Python 3.8 or later

Install Python using MiniConda

  1. Download and install MiniConda From here
  2. Create a new environment using the following command:
$ conda create -n vodafone-chatbot python=3.10

Another way to create a new environment is by using the following command:

$ conda create --name vodafone-chatbot python=3.10
  1. Activate the environment:
$ conda activate vodafone-chatbot

(Optional) work on powershell environment

  1. Install Virtualenv
$ pip install virtualenv
  1. Create a new environment using the following command:
$ python -m venv vodafone-chatbot
  1. Activate the environment:
$ .\vodafone-chatbot\Scripts\Activate.ps1

(Optional) Setup your command line for better readability if you using WSL

export PS1=export PS1="\[\033[01;32m\]\u@\h:\w\n\[\033[00m\]\$ "

Installation

Install the required packages in src directory

$ pip install -r requirements.txt

Setup the environment variables

$ cp .env.example .env

Set your environment variables in the .env file. Like API_KEYS value.

Get open-source models using groq

Create a private key for free and choose suitable open-source model as API from here

Download your local LLM using Ollama

Download Ollama

You could download ollama from here

Download your suitable Model using Ollama run/pull and model's ID for example:

$ ollama pull llama3.1

You could know your downloaded list using the following command

$ ollama list

Run app.py in src directory using streamlit

$ streamlit run app.py