This platform provides a robust solution for uploading and interacting with PDF documents. It leverages the capabilities of LangChain and OpenAI APIs to offer an enhanced chat-based user experience. This documentation will guide you through the setup and usage of the platform.
Before proceeding, ensure you have Python installed on your system. This platform has been tested on MacOS, Windows, Linux, and WSL environments.
-
Creating a Virtual Environment: To avoid any conflicts with existing Python packages, it's recommended to use a virtual environment. Run the following commands based on your operating system:
-
MacOS/WSL/Linux:
python -m venv .venv source .venv/bin/activate
-
Windows:
python -m venv .venv .\.venv\Scripts\activate
-
-
Install Dependencies: With the virtual environment activated, install the required dependencies:
pip install -r requirements.txt
-
Initialize Database: The platform uses a database to manage PDF documents and user interactions. Initialize it using:
flask --app app.web init-db
The application consists of three main components: the server, a worker, and Redis. Each of these needs to be running simultaneously in separate terminal windows.
-
Running the Python Server: Start the server to handle web requests:
inv dev
-
Running the Worker: This worker process handles background tasks and processing:
inv devworker
-
Running Redis: Redis is used for managing state and caching:
redis-server
Once all processes are running, the platform is ready for use. Users can upload, view, and interact with PDF documents through a chat interface, leveraging advanced natural language processing technologies.
- Stopping the Processes: To stop any of the running components (server, worker, or Redis), select the corresponding terminal window and press
Control-C
. - Resetting the Database: If you need to reset the database to its initial state, use the following command:
flask --app app.web init-db