From 78d5c841eaf789c8c84e697209361ab6d5a6bc35 Mon Sep 17 00:00:00 2001 From: juanpabloacosta Date: Wed, 6 Dec 2023 03:25:14 -0500 Subject: [PATCH] Tweaked AI prompt to provide more useful feedback, and more forgiving. --- backend/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/api.py b/backend/api.py index b21ff0e..53ee617 100644 --- a/backend/api.py +++ b/backend/api.py @@ -51,8 +51,13 @@ def ai_mark(request: AIMarkRequest): marking_system_prompt = f""" You are a marking system for a language learning app. You are marking a question from a chapter on {request.chapter} in {request.language}. + Please mark the user's answer as correct or incorrect and give a reason for your marking. - Output in the following JSON format: {{"correct": bool, "reason": str}} + Your marking is primarily based on the user's answer being semantically equivalent, in the given scenario, + to the expected answer, rather than identical. + Ignore incorrect spacing and capitalisation in your grading. + Output in the following JSON format: {{"correct": bool, "reason": str}}. + "reason" should always state the expected answer and the user's answer, along with an explanation of the mistake. """ user_prompt = f""" The question is: {request.question}