PolicyEngine / policyengine-app

PolicyEngine's free web app for computing the impact of public policy.
GNU Affero General Public License v3.0
35 stars 90 forks source link

Refactor `Analysis.jsx` so that the prompt sits in its own file #1751

Closed anth-volk closed 1 month ago

anth-volk commented 1 month ago

This would allow easier editing, easier conditional implementation of various different prompts (if we go that way), etc. Note: This should be done after Friday, May 10.

anmolchhabra21 commented 1 month ago

I have refactored the Analysis.jsx part to keep the different prompts in a single file named PromptContent.jsx, and now the Analysis.jsx has an import to this file, with the rendering logic and frontend. It was working fine on my local: image

But I found out there were some terms like {{povertyImpact}} and {{inequalityImpact}} in the contents. To check, I headed to the live website https://policyengine.org/us/research/gpt-analysis, and there also was the same, Have we kept it intentionally? I was just not sure if we wanted to change it. Please let me know if we need to update that part, and then I can include that in my PR. Here is its related image in the live website: image

MaxGhenis commented 1 month ago

Yes it's intentional. We replace them with charts.

anth-volk commented 1 month ago

Yeah, echoing Max, you can keep those exactly as they are.