groqchatbot is a high-performance conversational chatbot built using Streamlit and Groq's Language Processing Unit (LPU). It leverages the LangChain framework to provide a seamless and interactive chat experience. This chatbot can answer questions, provide information, and engage in friendly conversations with users.
- Fast and Efficient: Powered by Groq's LPU for low latency and high performance.
- Customizable: Modify system prompts and choose from various models.
- Interactive UI: Built with Streamlit for an intuitive user interface.
- Conversational Memory: Maintains context with a configurable memory length.
-
Clone the repository:
git clone https://github.com/SauravSrivastav/groqchatbot.git cd groqchatbot
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up your Groq API Key:
- Sign up on the Groq website and generate an API key.
- Set the API key as an environment variable:
export GROQ_API_KEY=your_groq_api_key
-
Start the Streamlit app:
streamlit run app.py
-
Open your browser and navigate to
http://localhost:8501
to interact with the chatbot.
- Enter your Groq API Key in the sidebar.
- Customize the system prompt to guide the chatbot's behavior.
- Choose a model from the dropdown menu.
- Adjust the conversational memory length using the slider.
- Ask a question in the text input box and get responses from the chatbot.
startLine: 1
endLine: 17
- Import necessary libraries and modules.
- Set up the main function for the Streamlit application.
startLine: 24
endLine: 32
- Provide instructions for obtaining the Groq API key.
- Input field for the user to enter their API key.
startLine: 35
endLine: 49
- Display the Groq logo.
- Set the title and greeting message.
- Add customization options for system prompts and model selection.
startLine: 67
endLine: 83
- Provide user manuals for each model.
- Configure conversational memory length.
startLine: 85
endLine: 95
- Initialize session state for chat history.
- Save context for previous messages.
startLine: 98
endLine: 143
- Initialize the Groq LangChain chat object.
- Construct a chat prompt template.
- Create a conversation chain and handle user questions.
- Display chatbot responses and handle errors.
Contributions are welcome! If you'd like to improve groqchatbot, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
Have questions or suggestions? Reach out to us:
- π§ Email: [email protected]
- πΌ LinkedIn: in/sauravsrivastav2205
- π GitHub: https://github.com/SauravSrivastav
Happy Chatting! π