This project is an AI chatbot application built using Streamlit. It leverages OpenAI's GPT-4o-mini model to provide intelligent and context-aware responses. The application supports multiple chat sessions and allows users to input their OpenAI API key for personalized interactions.
- Multiple chat sessions management
- User-friendly interface with Streamlit
- Secure API key input
- Context-aware responses using GPT-4o-mini
- Clone the repository:
git clone https://github.com/yourusername/ai-chatbot.git cd ai-chatbot
- Create a virtual enviorment:
python -m venv venv
- Activate the virtual enviorment:
venv/Scripts/activate
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the root directory and add your OpenAI API key and Langchain API key:OPENAI_API_KEY=your_openai_api_key LANGCHAIN_API_KEY=your_langchain_api_key
To run the application, use the following command:
streamlit run src/app.py
- config.py: Manages configuration settings and environment variables.
- session_manager.py: Handles session management and chat history.
- chatbot.py: Implements the core chatbot functionality using LangChain components.
- app.py: Main Streamlit application file that coordinates between different components.
- /script: Contains just the script for running the chatbot without ui with explanation on how everythin works. It is exactly the same as I write while creating it without ui for instructions and any related references.
- /src: Contains the main application files.
- config.py: Configuration management.
- session_manager.py: Session management.
- chatbot.py: Chatbot logic.
- app.py: Streamlit application.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.