|
15 | 15 |
|
16 | 16 | # --------------------- WebShop --------------------- # |
17 | 17 | WEBSHOP_TEMPLATE_NO_HIS = """ |
18 | | -You are an expert agent operating in the WebShop e‑commerce environment. |
| 18 | +You are an expert agent operating in the WebShop e-commerce environment. |
19 | 19 | Your task is: {task_description} |
20 | 20 | Your current observation is: {current_observation} |
21 | 21 | Your admissible actions of the current situation are: [ |
|
25 | 25 | Please begin by analyzing the situation and planning your approach: |
26 | 26 |
|
27 | 27 | <plan> |
28 | | -Analyze the current shopping situation and devise a plan to accomplish the task: {task_description} |
| 28 | +Analyze the current shopping situation and devise a plan to accomplish the task: |
29 | 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? |
30 | 31 | Based on the current observation, what should be my immediate next step? |
31 | | -How does this action advance my plan toward completing the shopping goal? |
32 | 32 | </plan> |
33 | 33 |
|
34 | 34 | Finally, choose ONE admissible action for the current step and present it within <action> </action> tags. |
35 | 35 | """ |
36 | 36 |
|
37 | 37 | WEBSHOP_TEMPLATE = """ |
38 | | -You are an expert agent operating in the WebShop e‑commerce environment. |
| 38 | +You are an expert agent operating in the WebShop e-commerce environment. |
39 | 39 | Your task is: {task_description} |
40 | 40 | 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} |
41 | 41 | You are now at step {current_step} and your current observation is: {current_observation} |
42 | | -Your admissible actions of the current situation are: [ |
43 | | -{available_actions} |
44 | | -]. |
| 42 | +Your admissible actions of the current situation are: [{available_actions}]. |
45 | 43 |
|
46 | 44 | Now it's your turn to take an action. |
47 | 45 |
|
48 | | -You should first recall relevant past experience and reason from our conversation history, then MUST summarize within <memory_recall> </memory_recall> tags like this: |
| 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: |
49 | 47 |
|
50 | | -<memory_recall> |
| 48 | +<memory_analysis> |
51 | 49 | [Recall relevant past experiences and reason from our conversation history] |
52 | | -Recent action history ({step_count} steps taken): {action_history} |
53 | | -- What similar shopping situations have I encountered? |
54 | | -- What strategies worked or failed before (e.g., search terms, product filtering, option selection)? |
55 | | -- What products, attributes, or pages have I already explored? |
56 | | -- What was my previous reasoning and plan? |
57 | | -</memory_recall> |
| 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> |
58 | 53 |
|
59 | 54 | After that, you should reflect on the last action and its outcome, then MUST summarize within <reflection> </reflection> tags like this: |
60 | 55 |
|
|
63 | 58 | - What did my last action accomplish? |
64 | 59 | - Was it successful or did it encounter issues? |
65 | 60 | - How does this outcome affect my plan? |
66 | | -- Am I making progress toward the task goal: {task_description}? |
| 61 | +- Am I making progress toward the task goal? |
67 | 62 | </reflection> |
68 | 63 |
|
69 | | -After that, you should plan the next step based on memory and reflection, then MUST summarize within <think> </think> tags like this: |
| 64 | +After that, you should plan the next step based on memory and reflection, then MUST summarize within <plan> </plan> tags like this: |
70 | 65 |
|
71 | | -<think> |
| 66 | +<plan> |
72 | 67 | [Plan the next step based on memory and reflection] |
73 | 68 | - Given what I've learned, what should I do next? |
| 69 | +- Please explain why this plan is helpful for the next action? |
74 | 70 | - How does this action fit into my overall shopping strategy? |
75 | 71 | - What do I expect this action to achieve now? |
76 | | -</think> |
| 72 | +</plan> |
77 | 73 |
|
78 | 74 | Finally, choose ONE admissible action for the current step and present it within <action> </action> tags. |
79 | 75 | """ |
0 commit comments