tikendraw commited on
Commit
57a1cbb
·
1 Parent(s): 5f096f6

prompt fix

Browse files
core/prompts/cot.py CHANGED
@@ -37,16 +37,16 @@ use the following JSON structures as templates. Ensure that your output strictly
37
 
38
  Instructions for review_prompt:
39
  - Use "thought" to thoroughly review the previous answer, analyzing its logic and completeness.
40
- - "step_title" should reflect that this is a review step.
41
  - Provide an improved or revised answer in the "answer" field.
42
  - In "critic", evaluate the revised answer and suggest any further improvements.
43
  - Set "next_step" to true if more revision is needed, false if this review is sufficient.
44
  - Always set "is_final_answer" to false in the review_prompt.
45
 
46
  {
47
- "thought": "Detailed review of the previous answer, considering its strengths and weaknesses",
48
  "step_title": "Review and Improvement",
49
- "answer": "Revised or improved answer based on the review",
50
  "critic": "Evaluation of the revised answer, suggesting further improvements if necessary",
51
  "next_step": true,
52
  "is_final_answer": false
 
37
 
38
  Instructions for review_prompt:
39
  - Use "thought" to thoroughly review the previous answer, analyzing its logic and completeness.
40
+ - "step_title" name the step based on the aim of the thoughts, do not repeat previous step title.
41
  - Provide an improved or revised answer in the "answer" field.
42
  - In "critic", evaluate the revised answer and suggest any further improvements.
43
  - Set "next_step" to true if more revision is needed, false if this review is sufficient.
44
  - Always set "is_final_answer" to false in the review_prompt.
45
 
46
  {
47
+ "thought": "Detailed review of the previous answer, considering its strengths and weaknesses, you thought process",
48
  "step_title": "Review and Improvement",
49
+ "answer": "Revised or improved answer based on the review and thoughts, elaborate answer",
50
  "critic": "Evaluation of the revised answer, suggesting further improvements if necessary",
51
  "next_step": true,
52
  "is_final_answer": false
core/prompts/decision_prompt.py CHANGED
@@ -8,9 +8,17 @@ class Decision(Enum):
8
 
9
  class Prompts(BaseModel):
10
  system_prompt: str = 'THINK STEP BY STEP OR ANSWER ACCORDINGLY'
11
- review_prompt: str = 'REVIEW IT'
12
- final_answer_prompt: str = 'FINALIZE IT'
13
 
 
 
 
 
 
 
 
 
14
  class COTorDAPromptOutput(BaseModel):
15
  problem: str
16
  decision: Decision
 
8
 
9
  class Prompts(BaseModel):
10
  system_prompt: str = 'THINK STEP BY STEP OR ANSWER ACCORDINGLY'
11
+ review_prompt: str | None = None
12
+ final_answer_prompt: str | None = None
13
 
14
+ # Validators to handle None values
15
+ @field_validator('review_prompt', mode='before')
16
+ def set_default_review_prompt(cls, value):
17
+ return value or 'REVIEW IT'
18
+
19
+ @field_validator('final_answer_prompt', mode='before')
20
+ def set_default_final_answer_prompt(cls, value):
21
+ return value or 'FINALIZE IT'
22
  class COTorDAPromptOutput(BaseModel):
23
  problem: str
24
  decision: Decision