Skip to content

trustbit/enterprise-rag-challenge-ui

Repository files navigation

Enterprise RAG Challenge UI & Submission Handling

Codebase for the Submission API and UI for the TIMETOACT Enterprise RAG Challenge taking place on 27th of February 2025.

Landing page

Source code

UI_sample_image.png

Before you start

Specify necessary variables in the .env file and adapt to needs.

Adapt URL in index.html to actual API domain.

Getting Started

Locally

Install dependencies (preferably in a virtual environment)

pip install -r requirements.txt

Run the app

python -m uvicorn src.main:app --reload

With Docker

Build docker image

docker build -t rag_challenge .

Run docker container

docker run -d -p 8000:8000 rag_challenge

Test submission with curl

Test UI submission (string)

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'

Test json file submission

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'

Test submission data check and submission with python

Run the file submit_via_API.py.

Run unittests

Note, that running the tests will generate two submissions, which will be stored in the specified path

pytest

Schema

{
  "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.

About

Codebase for the Enterprise RAG Challenge UI and submission handling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •