DocWorker is a Flask web application for running GPT operations over DOCX files.
To run DocWorker, you need an API Key from OpenAI (mine came with a $5 credit), and to install various Python modules using pip. Using Python venv is good practice, but not required. (If you do Python development or use Python modules installed with ppip, venv helps avoid pain with version conflicts.)
All commands should be run from the top level of the project directory.
pip install -r docworker/requirements.txt
flask --app docworker.analysis_app init-db
flask --app docworker.analysis_app set-user <user-name>
Example user name: test
flask --app docworker.analysis_app get-user <user-name>
Note the access key for later use.
export OPENAI_API_KEY=<key>
Run the app in debug mode with:
flask --app docworker.analysis_app run --debug
Run with OpenAI calls mocked out:
flask --app "docworker.analysis_app:create_app(fakeai=True)" run --debug
Open: http://localhost:5000/?authkey=<access_key>
Note: The login by email feature requires additional effort for setup. To use the system in test mode, simply follow the above pattern and include the test user's access key to the URL for the initial connection with a web browser.
Run System and Unit tests
make test
make unittest
make systest
pytest needs to by installed for the system tests.
Dockworker can be built into a module and installed on a production server, and run as a wsgi application with a server such as waitress. I have apache2 in front of waitress as a proxy. See the notes.txt file for more information.