Skip to content

Commit 2b995cf

Browse files
committed
[perf] update webshop modular rollout prompt
1 parent f408e94 commit 2b995cf

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

openmanus_rl/environments/prompts/webshop.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,59 @@
1818
You are an expert agent operating in the WebShop e-commerce environment.
1919
Your task is: {task_description}
2020
Your current observation is: {current_observation}
21-
Your admissible actions of the current situation are: [
22-
{available_actions}
23-
].
21+
Your admissible actions of the current situation are: {available_actions}.
2422
2523
Please begin by analyzing the situation and planning your approach:
2624
2725
<plan>
28-
Analyze the current shopping situation and devise a plan to accomplish the task:
29-
What are the key steps needed to complete this task (e.g., search with the right keywords, open a relevant product, compare options, select attributes, finalize)?
30-
How to advance our plan toward completing the shopping goal in immediate next step?
31-
Based on the current observation, what should be my immediate next step?
26+
Plan the next step:
27+
- Given what I've learned, what should I do next?
28+
- Please explain why this plan is helpful for the next action?
29+
- What do I expect this action to achieve?
3230
</plan>
3331
34-
Finally, choose ONE admissible action for the current step and present it within <action> </action> tags.
32+
<action>
33+
Finally, choose ONE admissible action for the current step and choose it within {available_actions}.
34+
</action>
3535
"""
3636

3737
WEBSHOP_TEMPLATE = """
3838
You are an expert agent operating in the WebShop e-commerce environment.
39-
Your task is: {task_description}
39+
Your task is to: {task_description}
4040
Prior to this step, you have already taken {step_count} step(s). Below are the most recent {history_length} observations and the corresponding actions you took: {action_history}
4141
You are now at step {current_step} and your current observation is: {current_observation}
42-
Your admissible actions of the current situation are: [{available_actions}].
42+
Your admissible actions of the current situation are: {available_actions}.
4343
4444
Now it's your turn to take an action.
4545
46-
You should first recall relevant past experience and reason from our conversation history, then MUST summarize within <memory_analysis> </memory_analysis> tags like this:
46+
You should first recall relevant past experience and reason from our conversation history, then MUST summarize within <memory> </memory> tags like this:
4747
48-
<memory_analysis>
49-
[Recall relevant past experiences and reason from our conversation history]
50-
- Please summarize the most relavent memory for this step.
51-
- Please explain why this memory is helpful for the next reflection and planning.
52-
</memory_analysis>
48+
<memory>
49+
Look at the past observations and actions from our conversation history.
50+
- Please retrieve the most relavent memory for this step including the relevant observation and action in a RAG style along with the step number.
51+
- These memory should be helpful milestones to solve this task.
52+
</memory>
5353
5454
After that, you should reflect on the last action and its outcome, then MUST summarize within <reflection> </reflection> tags like this:
5555
5656
<reflection>
57-
[Reflect on the last action and its outcome]
58-
- What did my last action accomplish?
59-
- Was it successful or did it encounter issues?
60-
- How does this outcome affect my plan?
57+
Reflect on the last action and its outcome
58+
- Did I complete the task goal?
59+
- Was last action successful or did it encounter issues?
6160
- Am I making progress toward the task goal?
61+
- If the action did not go as expected and did not result in progress, provide constructive feedback to guide the next planning step.
6262
</reflection>
6363
6464
After that, you should plan the next step based on memory and reflection, then MUST summarize within <plan> </plan> tags like this:
6565
6666
<plan>
67-
[Plan the next step based on memory and reflection]
67+
Plan the next step based on memory and reflection
6868
- Given what I've learned, what should I do next?
6969
- Please explain why this plan is helpful for the next action?
70-
- How does this action fit into my overall shopping strategy?
71-
- What do I expect this action to achieve now?
70+
- What do I expect this action to achieve?
7271
</plan>
7372
74-
Finally, choose ONE admissible action for the current step and present it within <action> </action> tags.
73+
<action>
74+
Finally, choose ONE admissible action for the current step and choose it within {available_actions}.
75+
</action>
7576
"""

0 commit comments

Comments
 (0)