To send requests to the API you need to add a .env file to the main folder with your access token. This should look like this:
TOKEN=<YOUR-ACCESS-TOKEN>Set up the config file as you need it:
server: address of the server
model: the model you want to use
prompt: path to the prompt .txt file
input: folder with the pdfs
output: folder where the results are saved
timeout: time until file upload is canceledYou can also set variable on specific runs by given them as hyperparameter like this:
python main.py output=path/to/folder
The main program can now be simply run by calling:
python main.py
The program produces multiple outputs in the given output folder.
First it saves all pain responses message as .txt files in the message folder.
Then it extracts the xml-part from the response. This is saved in the xml folder.
Lastly all references found are added to the output.csv.
The prompt can be found in the `prompts/prompt.txt file. You can also have multiple prompt files and select the one used in the config file or by a given parameter.