Study Buddy is a Streamlit application designed to facilitate interaction with research papers using OpenAI's GPT-4 API. This project demonstrates proficiency in Python development, API integration, logging, and environment management.
"Study Buddy" is an interactive platform designed to facilitate engagement with research papers through the use of OpenAI's GPT-4 model. The core functionality is powered by OpenAI's Assistants API, which is currently in beta. This README provides a comprehensive overview of the project, the technologies used, and the key learning experiences gained during its development.
- Python: The programming language used to build the application.
- Streamlit: For creating the web-based user interface.
- OpenAI's Assistants API: Leveraged for advanced AI capabilities. The API is in beta and offers cutting-edge features for handling and processing information.
main.py
: Entry point of the application that initializes the Streamlit interface and manages user interactions.AssistantManager.py
: Contains theAssistantManager
class responsible for managing interactions with the OpenAI API and handling file uploads.config/logging.py
: Configures logging for different components of the application.config/environment.py
: Manages environment variable loading and configuration.
- Python 3.12 or later
- Virtual environment (
venv
) - Streamlit
- OpenAI Python client
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project:OPENAI_API_KEY=<your-openai-api-key>
-
Run the application:
streamlit run main.py
- Upload Files: Use the file uploader in the sidebar to upload PDF, DOCX, or TXT files.
- Start Chatting: Click "Start chatting..." to initiate a conversation with the assistant.
- Interact with Assistant: Ask questions or request summaries of the uploaded documents.
- Beta API Integration: Working with a beta API involved navigating incomplete documentation and adapting to evolving features. This experience highlighted the importance of flexibility and self-reliance when using new and rapidly changing technologies.
- Custom Error Handling: Developing robust error handling and logging mechanisms was essential for dealing with the challenges presented by the beta API.