Add FastAPI endpoint for rubrics / lenses / badges
In addition to the user reviewing applications to apply a competition-based rubric, we plan to highlight when proposals are "interesting" from an additional point of view. The hope is that applying additional lenses to proposals will give reviewers a nudge to consider a proposal because it is strong in ways that aren't the focus of the competition rubric. We, along with Jeff Ubois, have identified these lenses to start with: https://www.impact.upenn.edu/choosing-change-five-dimensions-for-reducing-structural-inequality/
Our first supported use of lenses is to apply badges to proposals that indicate to the user that a proposal is interesting when viewed through a specific lens. We plan to pick <=3 lenses from the above link.
This is a stub issue to build an API endpoint for the frontend to talk to the middleware about lenses and badges. It is not yet clear what interactions we will need to support, but here is some potential workflow:
- Frontend sends a proposal to llm-api and says "apply the following lenses". Frontend handles its own batching logic, if needed.
- Frontend sends a batch of proposals and says "apply the following lenses" on a per-proposal or per-batch basis
- Frontend asks "what proposals match the following lens(es) at a specified confidence/percentile/score level"
Responses might include:
- proposal id
- A binary score (interesting vs not)
- A more granular score (how well does this match)
- Information to justify the binary or granular score, including quotes or pointers to specific parts of a proposal
We definitely want (1) and (2) in our mvp.