/Drug_order_bot

Langchain powered drug ordering chatbot using function calling and llama 3

Primary LanguagePython

LANCHAIN CHATBOT FOR MAKING ORDER ON A WEBSITE POWERED BY FUNCTION CALLING IN LLAMA3

Video link on how the chatbot performs : https://x.com/oboro_gideon/status/1803518453334110381?t=XEoxb39Q8owronYrfPSLgw&s=19

This is a chatbot designed to assist users in placing orderson a pharmaceutical e-commerce website using the function calling features in llama3.

The intuition about function calling, is that the model gives structured output which will be used to make an api call. The response of the api call will be passed back to the model to give back the final response.

Table of Contents

  • Features
  • Project Structure
  • Prerquisties
  • Installation
  • Usage

Features

  • Large Language Model(llm): Used langchain to access the llama3 api using Groq to interpret user messages.
  • DEBUG: Used Langsmith to debug model reponses and function calls
  • Retrieval Augmentation Generation(RAG): In order to give the model knowledge about drugs or product available in the store, A RAG system was built. This will enable the model to answer questions about the product with contextual understanding.
  • Order Placement: Facilitates the process of making orders for the users. All the user needs is to prompt the model to do so.
  • View Images of Product: Also, the chatbot can also display images of the product to the user, if asked to.
  • Error Handling: Error handling to ensure smooth user experience

Prerequistes

Before you begin, ensure you have met the following requirements:

  • Python 3.8 or higher
  • API keys or other necessary authentication credentials

Installation

  1. Clone the Repository: git clone git@github.com:GIDDY269/Drug_order_bot.git

  2. Install Dependencies: pip install -r requirements.txt

  3. Set Up Environment Variables: Create a .env file in the root directory of the project and add your API keys and other configurations: GROQ_API_KEY = API_KEY GEMINI API KEY = API_KEY SQL SERVER = SERVER DATABASE = DATABASE

Usage

  1. Run Chatbot: streamlit run drug_bot.py

  2. Interact with the chatbot: You can interact with the chatbot using the streamlit ui.