CodeChatBot is a chatbot that can chat with you about code, programming, and technology. It uses multiple AI models to generate responses. The chatbot is built using OpenAI, MistralAI, Anthropic, and Cohere. It can answer questions, provide code examples, and help you with your coding problems, read documents, and more.
This is a small project of mine to get familiar with the writing streamlit apps and LLM's. Please feel free to reach out to me with how I can improve this code as I am a hobbyist coder and always looking to improve.
- Chat with the chatbot about code, programming, and technology
- Get answers to your questions
- Get code examples
- Get help with your coding problems
- Read documents (pdf, docx, txt, etc.)
- Read URLs (web pages)
- Swap between different AI models during the conversation
- Clone the repository
- Install the requirements
- Run the chatbot
git clone https://github.com/CodeHalwell/code_chat_bot.git
cd code_chat_bot
pip install -r requirements.txt
touch .env
echo OPENAI=YOUR_KEY_GOES_HERE >> .env
echo MISTRAL=YOUR_KEY_GOES_HERE >> .env
echo ANTHROPIC=YOUR_KEY_GOES_HERE >> .env
echo COHERE=YOUR_KEY_GOES_HERE >> .env
streamlit run main.py
main.py
: Main file to run the chatbotdocument_loader.py
: Load documents from different sources
./previous_chats - Used to store and load previous chat logs
./upload_docs - Staging area for uploaded documents
- Start the chatbot by running
streamlit run main.py
- Select the AI provider you want to use
- Select the model you want to use
- Set the temperature and max tokens
- Select a system prompt depending on your purpose (e.g., ask a question, get code examples, read documents etc.)
- Load a document or URL if needed (optional)
- Start chatting with the chatbot
- Swap between different AI models during the conversation
- Save the chat log if needed wih the save state button (with a file name)
- You can also load previous chat logs by typing the file name in the load state box
- To clear the chat log, click the reset app button in the top left corner
- Monitor the costs incurred (approximate amount in $) by the chatbot in the lower left corner
- Fork the repository
- Create a new branch
- Make your changes
- Push your changes to your branch
- Create a pull request
- Wait for the pull request to be reviewed
- Merge the pull request
- Celebrate your contribution
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or suggestions, feel free to contact me.