File size: 1,470 Bytes
f49d5d2
 
 
 
 
 
 
1
2
3
4
5
6
7
8
# Developing this Application

To set up the local environment, first install Python. Then. run the command `python -m venv .venv`. This will create a virtual environment from which to host the application's dependencies. Then, run `. .venv/bin/activate`. This will ensure subsequent executions of the command "python" or "pip" will utilize the binaries and dependencies found in the virtual environment (the .venv folder), rather than the machine-global ones. This will enable you to keep the dependencies of this application separate from the dependencies used during any other execution of a python program. Then, run `pip install`. This will read the contents of the file "requirements.txt" and install those binaries into the .venv virtual environment (this will require a network connection).

The G34 application is run from the command-line with the command `python g34_final_project.py`. This will start the local server and expose the application at [http://127.0.0.1:7861]. You will need to launch the server with an environment variable OPENAI_API_KEY initialized to the API key you will use to access the OpenAI services.

To run the unit tests, run the command `python -m unittest`. To run a specific unit test, run the command `python -m unittest test/<the test file>.py`. This is useful for testing the data service or the LLM service, for example. The UI can be isolated and run with mock objects with the command `python -m unittest test/test_app.py`.