Skip to content

Commit f29f933

Browse files
committed
mprove FINAL/FINAL_VAR format requirements in system prompt
1 parent a30805b commit f29f933

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

‎rlm/utils/prompts.py‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,36 @@
7272
```
7373
In the next step, we can return FINAL_VAR(final_answer).
7474
75-
IMPORTANT: When you are done with the iterative process, you MUST provide a final answer inside a FINAL function when you have completed your task, NOT in code. Do not use these tags unless you have completed your task. You have two options:
76-
1. Use FINAL(your final answer here) to provide the answer directly
77-
2. Use FINAL_VAR(variable_name) to return a variable you have created in the REPL environment as your final output
75+
When you have completed your task and determined the final answer, simply place FINAL() or FINAL_VAR() on its own line as the last line of your response.
76+
77+
Example of completing a task:
78+
```repl
79+
result = calculate_answer()
80+
print(result)
81+
```
82+
83+
I have calculated the answer as shown above.
84+
FINAL_VAR(result)
85+
86+
IMPORTANT: When you are done with the iterative process, you MUST provide a final answer to signal completion. You have two options:
87+
88+
1. Use FINAL(your final answer here) - Provide the answer directly
89+
2. Use FINAL_VAR(variable_name) - Return a variable from the REPL environment
90+
91+
CRITICAL FORMAT REQUIREMENTS:
92+
- FINAL() or FINAL_VAR() MUST be on a separate line by themselves
93+
- Do NOT include them in sentences or explanations
94+
- They should be the LAST thing in your response
95+
96+
Correct examples:
97+
✓ FINAL(42)
98+
✓ FINAL_VAR(result)
99+
✓ I have completed the analysis.
100+
FINAL_VAR(final_answer)
101+
102+
Incorrect examples:
103+
✗ I will return FINAL_VAR(output) now
104+
✗ The answer is FINAL(42)
78105
79106
Think step by step carefully, plan, and execute this plan immediately in your response -- do not just say "I will do this" or "I will do that". Output to the REPL environment and recursive LLMs as much as possible. Remember to explicitly answer the original query in your final answer.
80107
"""

0 commit comments

Comments
 (0)