Skip to content

feat(back): Single endpoint for generating report and saving it and retrieve enpoint

Sondre Alfnes requested to merge feat/single-endpoint into dev

Create two new endpoint generate_report and generate_report that retrieves the unit data reflections and creates analyzed feedback that gets saved in the db. And a endpoint that retrieves the report.

How to test:

  • Make sure you are an admin (admin in .env)
  • Go to unit id one and answer the questions
  • Then run the endpoint in Postman (Generate report)
  • Then run the other endpoint to retrieve the report (Get report)

Note:

  • Looks like the prompt needs fine tuning since it does not work with dummy data
  • So write a long answer
  • Prompt does not accept two questions in on question (unit)

Other things added:

  • More error handling
  • Removed keys from analyze_feedback since its only the index
  • Added keys trough logic instead

Closes #9 (closed)

Co-authored-by: Sondre Alfnes sondre.alfnes@gmail.com

Co-authored-by: Ulrik Isdahl ulrikyi@stud.ntnu.no

Edited by Sondre Alfnes

Merge request reports