Update task_temp.py
Browse files- task_temp.py +11 -9
task_temp.py
CHANGED
|
@@ -2,8 +2,10 @@ rag_temp = '''First retrieve some example questions using the tool "QuestionRetr
|
|
| 2 |
QuestionRetrieverTool(subject="{subject}", topic="{topic}", grade="{grade}")
|
| 3 |
Use the returned questions as inspiration.
|
| 4 |
|
| 5 |
-
Then, generate a question and answer pair
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
After you propose a candidate, you MUST immediately call:
|
| 8 |
classify_and_score(
|
| 9 |
question=<just the question text>,
|
|
@@ -12,14 +14,14 @@ classify_and_score(
|
|
| 12 |
agg="max"
|
| 13 |
)
|
| 14 |
Use the "QuestionRetrieverTool" only once at the start.
|
| 15 |
-
Keep answers
|
| 16 |
Use the returned dict:
|
| 17 |
- print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}}
|
| 18 |
Additionally, when you call classify_and_score, pass the exact question text you propose.
|
| 19 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 20 |
'''
|
| 21 |
# RAG + Classification + Generation
|
| 22 |
-
rag_cls_temp = '''First retrieve
|
| 23 |
QuestionRetrieverTool(subject="{subject}", topic="{topic}", grade="{grade}")
|
| 24 |
Use the returned questions to inspire your own candidate.
|
| 25 |
|
|
@@ -36,10 +38,10 @@ classify_and_score(
|
|
| 36 |
|
| 37 |
Use the returned dict:
|
| 38 |
- If ok == True: print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}} and finish.
|
| 39 |
-
- If ok == False: briefly explain the needed shift, revise the question based on the feedback from the results of classify_and_score from the
|
| 40 |
-
Repeat up to {attempts} attempts.
|
| 41 |
Use the "QuestionRetrieverTool" only once at the start.
|
| 42 |
-
Keep answers
|
| 43 |
Additionally, when you call classify_and_score, pass the exact question text you propose.
|
| 44 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 45 |
'''
|
|
@@ -54,7 +56,7 @@ Use the returned dict:
|
|
| 54 |
- If ok == True: print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}} and finish.
|
| 55 |
- If ok == False: briefly explain the needed shift, revise the question, and call classify_and_score again.
|
| 56 |
Repeat up to {attempts} attempts.
|
| 57 |
-
|
| 58 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 59 |
'''
|
| 60 |
# Generation only
|
|
@@ -71,7 +73,7 @@ Provide the question and answer in the following JSON format:
|
|
| 71 |
"reasoning": "..."
|
| 72 |
}}
|
| 73 |
Ensure that the question is clear, concise, and appropriate for the specified grade level and subject matter.
|
| 74 |
-
Keep answers
|
| 75 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 76 |
'''
|
| 77 |
|
|
|
|
| 2 |
QuestionRetrieverTool(subject="{subject}", topic="{topic}", grade="{grade}")
|
| 3 |
Use the returned questions as inspiration.
|
| 4 |
|
| 5 |
+
Then, generate a question and answer pair for the given target cognitive demand while taking into consideration the examples that were retrived.
|
| 6 |
+
|
| 7 |
+
You generate {subject} question for {grade} on "{topic}".
|
| 8 |
+
|
| 9 |
After you propose a candidate, you MUST immediately call:
|
| 10 |
classify_and_score(
|
| 11 |
question=<just the question text>,
|
|
|
|
| 14 |
agg="max"
|
| 15 |
)
|
| 16 |
Use the "QuestionRetrieverTool" only once at the start.
|
| 17 |
+
Keep answers well structured and detailed.
|
| 18 |
Use the returned dict:
|
| 19 |
- print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}}
|
| 20 |
Additionally, when you call classify_and_score, pass the exact question text you propose.
|
| 21 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 22 |
'''
|
| 23 |
# RAG + Classification + Generation
|
| 24 |
+
rag_cls_temp = '''First retrieve example questions using the tool "QuestionRetrieverTool".
|
| 25 |
QuestionRetrieverTool(subject="{subject}", topic="{topic}", grade="{grade}")
|
| 26 |
Use the returned questions to inspire your own candidate.
|
| 27 |
|
|
|
|
| 38 |
|
| 39 |
Use the returned dict:
|
| 40 |
- If ok == True: print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}} and finish.
|
| 41 |
+
- If ok == False: briefly explain the needed shift, revise the question based on the feedback from the results of classify_and_score from the 1 preceding question to the current generated candidate and call classify_and_score again.
|
| 42 |
+
Repeat max up to {attempts} attempts.
|
| 43 |
Use the "QuestionRetrieverTool" only once at the start.
|
| 44 |
+
Keep answers well structured and detailed.
|
| 45 |
Additionally, when you call classify_and_score, pass the exact question text you propose.
|
| 46 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 47 |
'''
|
|
|
|
| 56 |
- If ok == True: print ONLY compact JSON {{"question": "...", "answer": "...", "reasoning": "..."}} and finish.
|
| 57 |
- If ok == False: briefly explain the needed shift, revise the question, and call classify_and_score again.
|
| 58 |
Repeat up to {attempts} attempts.
|
| 59 |
+
Keep answers well structured and detailed.
|
| 60 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 61 |
'''
|
| 62 |
# Generation only
|
|
|
|
| 73 |
"reasoning": "..."
|
| 74 |
}}
|
| 75 |
Ensure that the question is clear, concise, and appropriate for the specified grade level and subject matter.
|
| 76 |
+
Keep answers well structured and detailed.
|
| 77 |
If you output JSON, ensure it is valid JSON (no trailing commas, use double quotes).
|
| 78 |
'''
|
| 79 |
|