Codebase for the Submission API and UI for the TIMETOACT Enterprise RAG Challenge taking place on 27th of February 2025.
Specify necessary variables in the .env
file and adapt to needs.
Adapt URL in index.html to actual API domain.
Install dependencies (preferably in a virtual environment)
pip install -r requirements.txt
Run the app
python -m uvicorn src.main:app --reload
Build docker image
docker build -t rag_challenge .
Run docker container
docker run -d -p 8000:8000 rag_challenge
curl -X 'POST' \
'http://127.0.0.1:8000/submit-ui' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'content=%5B%7B%22question%22%3A%22Q1%22%2C%22schema%22%3A%22name%22%2C%22answer%22%3A%22A1%22%7D%2C%7B%22question%22%3A%22Q2%22%2C%22schema%22%3A%22number%22%2C%22answer%22%3A2.5%7D%2C%7B%22question%22%3A%22Q2%22%2C%22schema%22%3A%22boolean%22%2C%22answer%22%3Atrue%7D%5D'
curl -X 'POST' \
'http://127.0.0.1:8000/submit' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@test/samples/sample_answer.json;type=application/json'
Run the file submit_via_API.py
.
Note, that running the tests will generate two submissions, which will be stored in the specified path
pytest
{
"team_email": "[email protected]",
"submission_name": "test-team",
"answers": [
{
"question_text": "What was the Net Profit Margin of \"Oesterreichische Kontrollbank\" in June 30, 2023?",
"kind": "number",
"value": 0.1243,
"references": [
{
"pdf_sha1": "053b7cb83115789346e2a9efc7e2e640851653ff",
"page_index": 3
}
]
},
{
"question_text": "What was the total liabilities of \"CrossFirst Bank\" in the fiscal year 2023?",
"kind": "number",
"value": 5992487000,
"references": []
},
]
}
Also see the sample answer in the file sample_answer.json
.