This is a simple AI chatbot using Streamlit and Groq's LLM (Llama3-70b-8192). It maintains a chat history and generates responses to user queries using AI.
Ensure you have the following installed:
- Python (>=3.8)
- Required Python libraries:
os,dotenv,langchain_groq,streamlit
-
Clone the repository (if applicable)
git clone https://github.com/BLUERAY94/yt_AI_ChatBot.git cd yt_AI_ChatBot -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
- Create a
.envfile in the project root. - Add the following line and replace
your_groq_api_keywith your actual key:GROQ_API_KEY=your_groq_api_key
- Create a
- Open a terminal and navigate to the project directory.
- Run the Streamlit app:
streamlit run chatbot.py.py
- Loads Groq API Key from
.envfile. - Uses Llama3-70b-8192 model with temperature
0. - Displays user input and chatbot responses in a chat interface.
- Maintains chat history throughout the session.
- Load API Key: The
.envfile is read to set the Groq API key. - Initialize LLM: Creates a chatbot object using
ChatGroq. - Display UI: Uses Streamlit to create an interactive chat interface.
- Chat Processing:
- Stores user input in session history.
- Prepares a prompt with a system instruction.
- Sends the query to the AI model.
- Displays and stores the AI response.
- Ensure a valid API key is provided.
- This chatbot is a basic implementation and can be further enhanced.