Skip to content

Commit 9cdf0d9

Browse files
aymeric-roucherbaptistecolle
authored andcommitted
Improve explanations in prompt
1 parent b6de9cb commit 9cdf0d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/generate_agent_traces.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,17 @@ def model(messages, stop_sequences = None):
120120
return None
121121

122122
def process_example(example, session, args, output_file, pbar=None):
123-
prompt = f"Here is a task to solve using a function: {example[args.prompt_column]}\n\nNow write a function that solves the problem, test it and return it using final_answer(your_function). ALWAYS RUN THE FUNCTION IN A CODE SNIPPET WITH TEST CASES BEFORE RETURNING IT."
123+
prompt = f"""Here is a task to solve using a function:
124+
{example[args.prompt_column]}
125+
126+
Now write a function that solves the problem, test it and return it using final_answer(your_function).
127+
The function should take the inputs described in the task above, using them in this way: the function will be passed the 'lines' described in the task as different arguments.
128+
For instance:
129+
- if the task says 'the first line is a number, the second line is a list of numbers', your function should take two arguments like this: def your_function(n, numbers).
130+
- if the task says 'the first line will contain a number n, the n lines after that will be strings', your function should take flexible arguments like this: def your_function(n, *n_lines).
131+
Make sure to properly extract the inputs from the string arguments.
132+
ALWAYS RUN THE FUNCTION IN A CODE SNIPPET WITH TEST CASES BEFORE RETURNING IT.
133+
"""
124134
try:
125135
agent_runs = []
126136
for _ in range(args.num_generations):

0 commit comments

Comments
 (0)