From 84527f6d016e6de82cce10a49a6a1295fa16dab6 Mon Sep 17 00:00:00 2001 From: neagualexa Date: Wed, 19 Feb 2025 17:50:43 +0000 Subject: [PATCH 1/3] fix: small fix prompt --- index.py | 2 +- src/agents/utils/parse_json_to_prompt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 04b13b6..5ef3bb8 100644 --- a/index.py +++ b/index.py @@ -15,7 +15,7 @@ def handler(event: JsonType, context): """ # Log the input event for debugging purposes - # print("Received event:", json.dumps(event, indent=2)) + print("Received event:", json.dumps(event, indent=2)) if "body" not in event: return { diff --git a/src/agents/utils/parse_json_to_prompt.py b/src/agents/utils/parse_json_to_prompt.py index 278aa84..c83946b 100644 --- a/src/agents/utils/parse_json_to_prompt.py +++ b/src/agents/utils/parse_json_to_prompt.py @@ -195,7 +195,7 @@ def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: Li questionDetails = f"""This is the question I am currently working on. I am currently working on Part ({convert_index_to_lowercase_letter(questionAccessInformation.currentPart.position)}). Below, you'll find its details, including the parts of the question, my responses for each response area, and the feedback I received. This information highlights my efforts and progress so far. Use this this information to inform your understanding about the question materials provided to me and my work on them. Maths equations are in KaTex format, preserve them the same. Use British English spellings. {f'# Question Set {questionInformation.setNumber + 1}: {questionInformation.setName};' if questionInformation.setName and questionInformation.setNumber else ''} -# Question{f' {questionInformation.setNumber + 1}.{questionInformation.questionNumber + 1}' if questionInformation.setNumber and questionInformation.questionNumber else ''}: {questionInformation.questionTitle}; +# Question {f' {questionInformation.setNumber + 1}.{questionInformation.questionNumber + 1}' if questionInformation.setNumber and questionInformation.questionNumber else ''}: {questionInformation.questionTitle}; Guidance to Solve the Question: {questionInformation.questionGuidance or 'None'}; Description of Question: {questionInformation.questionContent}; Expected Time to Complete the Question: {f'{questionInformation.durationLowerBound} - {questionInformation.durationUpperBound} min;' if questionInformation.durationLowerBound and questionInformation.durationUpperBound else 'No specified duration.'} From 5fafc7c9916c827311cc3edc77ded175d1ecfcf7 Mon Sep 17 00:00:00 2001 From: neagualexa Date: Wed, 19 Feb 2025 17:52:01 +0000 Subject: [PATCH 2/3] debug print --- src/agents/utils/parse_json_to_prompt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agents/utils/parse_json_to_prompt.py b/src/agents/utils/parse_json_to_prompt.py index c83946b..107a3bd 100644 --- a/src/agents/utils/parse_json_to_prompt.py +++ b/src/agents/utils/parse_json_to_prompt.py @@ -214,4 +214,6 @@ def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: Li result = f"{questionDetails}\n{partsDetails}".replace(" ", "").replace(" ", "").replace("\n\n", "\n") + print("PROMPT::", result) + return result From 80b7c10560318f5a1efadee6d8e1ebcf3bc5d778 Mon Sep 17 00:00:00 2001 From: neagualexa Date: Wed, 19 Feb 2025 18:24:44 +0000 Subject: [PATCH 3/3] fix: question set numbers --- src/agents/utils/parse_json_to_prompt.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/agents/utils/parse_json_to_prompt.py b/src/agents/utils/parse_json_to_prompt.py index 107a3bd..74c5fe8 100644 --- a/src/agents/utils/parse_json_to_prompt.py +++ b/src/agents/utils/parse_json_to_prompt.py @@ -194,8 +194,8 @@ def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: Li questionDetails = f"""This is the question I am currently working on. I am currently working on Part ({convert_index_to_lowercase_letter(questionAccessInformation.currentPart.position)}). Below, you'll find its details, including the parts of the question, my responses for each response area, and the feedback I received. This information highlights my efforts and progress so far. Use this this information to inform your understanding about the question materials provided to me and my work on them. Maths equations are in KaTex format, preserve them the same. Use British English spellings. -{f'# Question Set {questionInformation.setNumber + 1}: {questionInformation.setName};' if questionInformation.setName and questionInformation.setNumber else ''} -# Question {f' {questionInformation.setNumber + 1}.{questionInformation.questionNumber + 1}' if questionInformation.setNumber and questionInformation.questionNumber else ''}: {questionInformation.questionTitle}; +{f'# Question Set {questionInformation.setNumber + 1}: {questionInformation.setName};' if ((questionInformation.setName is not None) and (questionInformation.setNumber is not None)) else ''} +# Question {f' {questionInformation.setNumber + 1}.{questionInformation.questionNumber + 1}' if ((questionInformation.setNumber is not None) and (questionInformation.questionNumber is not None)) else ''}: {questionInformation.questionTitle}; Guidance to Solve the Question: {questionInformation.questionGuidance or 'None'}; Description of Question: {questionInformation.questionContent}; Expected Time to Complete the Question: {f'{questionInformation.durationLowerBound} - {questionInformation.durationUpperBound} min;' if questionInformation.durationLowerBound and questionInformation.durationUpperBound else 'No specified duration.'} @@ -214,6 +214,4 @@ def format_part_details(part: PartDetails, currentPart: CurrentPart, summary: Li result = f"{questionDetails}\n{partsDetails}".replace(" ", "").replace(" ", "").replace("\n\n", "\n") - print("PROMPT::", result) - return result