You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Note: put the log field first to trigger the CoT
11
-
constvlCurrentLog=`"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The typical log looks like "The user wants to do ... . According to the instruction and the previous logs, now i should use action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.`;
9
+
10
+
constvlCurrentLog=`"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The log should contain the following information: "The user wants to do ... . According to the instruction and the previous logs, next step is to .... Now i am going to compose an action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.`;
12
11
constllmCurrentLog=`"log": string, // Log what the next actions you can do according to the screenshot and the instruction. The typical log looks like "Now i want to use action '{ action-type }' to do ..". If no action should be done, log the reason. ". Use the same language as the user's instruction.`;
13
12
14
13
constcommonOutputFields=`"error"?: string, // Error messages about unexpected situations, if any. Only think it is an error when the situation is not foreseeable according to the instruction. Use the same language as the user's instruction.
@@ -215,7 +214,7 @@ For example, when the instruction is "click 'Confirm' button, and click 'Yes' in
215
214
this and output the JSON:
216
215
217
216
{
218
-
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, now i should use action 'Tap' to click 'Yes' in popup.",
217
+
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, next step is to tap the 'Yes' button in the popup. Now i am going to compose an action 'Tap' to click 'Yes' in popup.",
219
218
"action": {
220
219
"type": "Tap",
221
220
"param": {
@@ -312,7 +311,7 @@ By viewing the page screenshot and description, you should consider this and out
312
311
* The language switch button is shown in the screenshot, and can be located by the page description or the id marked with a rectangle. So we can plan a Tap action to do this.
313
312
* Plan a Sleep action to wait for 1 second to ensure the language options are displayed.
314
313
* The "English" option button is not shown in the screenshot now, it means it may only show after the previous actions are finished. So don't plan any action to do this.
315
-
* Log what these action do: Click the language switch buttonto open the language options. Wait for 1 second.
314
+
* Compose the log: The user wants to do click the language switch button, wait 1s, click "English". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.
316
315
* The task cannot be accomplished (because the last tapping action is not finished yet), so the \`more_actions_needed_by_instruction\` field is true. The \`error\` field is null.
317
316
318
317
{
@@ -332,7 +331,7 @@ By viewing the page screenshot and description, you should consider this and out
332
331
],
333
332
"error": null,
334
333
"more_actions_needed_by_instruction": true,
335
-
"log": "Click the language switch buttonto open the language options. Wait for 1 second",
334
+
"log": "The user wants to do click the language switch button, wait 1s, click \"English\". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.",
336
335
}
337
336
338
337
### Example: What NOT to do
@@ -355,7 +354,7 @@ Wrong output:
355
354
}
356
355
],
357
356
"more_actions_needed_by_instruction": false, // WRONG: should be true
358
-
"log": "Click the language switch buttonto open the language options",
357
+
"log": "The user wants to do click the language switch button, wait 1s, click \"English\". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.",
Copy file name to clipboardExpand all lines: packages/core/tests/unit-test/prompt/__snapshots__/prompt.test.ts.snap
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -554,7 +554,7 @@ By viewing the page screenshot and description, you should consider this and out
554
554
* The language switch button is shown in the screenshot, and can be located by the page description or the id marked with a rectangle. So we can plan a Tap action to do this.
555
555
* Plan a Sleep action to wait for 1 second to ensure the language options are displayed.
556
556
* The "English" option button is not shown in the screenshot now, it means it may only show after the previous actions are finished. So don't plan any action to do this.
557
-
* Log what these action do: Click the language switch buttonto open the language options. Wait for 1 second.
557
+
* Compose the log: The user wants to do click the language switch button, wait 1s, click "English". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.
558
558
* The task cannot be accomplished (because the last tapping action is not finished yet), so the \`more_actions_needed_by_instruction\` field is true. The \`error\` field is null.
559
559
560
560
{
@@ -574,7 +574,7 @@ By viewing the page screenshot and description, you should consider this and out
574
574
],
575
575
"error": null,
576
576
"more_actions_needed_by_instruction": true,
577
-
"log": "Click the language switch buttonto open the language options. Wait for 1 second",
577
+
"log": "The user wants to do click the language switch button, wait 1s, click "English". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.",
578
578
}
579
579
580
580
### Example: What NOT to do
@@ -597,7 +597,7 @@ Wrong output:
597
597
}
598
598
],
599
599
"more_actions_needed_by_instruction": false, // WRONG: should be true
600
-
"log": "Click the language switch buttonto open the language options",
600
+
"log": "The user wants to do click the language switch button, wait 1s, click "English". According to the instruction and the previous logs, next step is to tap the language switch button to open the language options. Now i am going to compose an action 'Tap' to click the language switch button.",
601
601
}
602
602
"
603
603
`;
@@ -643,7 +643,7 @@ Field description:
643
643
644
644
Return in JSON format:
645
645
{
646
-
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The typical log looks like "The user wants to do ... . According to the instruction and the previous logs, now i should use action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
646
+
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The log should contain the following information: "The user wants to do ... . According to the instruction and the previous logs, next step is to .... Now i am going to compose an action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
647
647
"error"?:string, // Error messages about unexpected situations, if any. Only think it is an error when the situation is not foreseeable according to the instruction. Use the same language as the user's instruction.
648
648
"more_actions_needed_by_instruction": boolean, // Consider if there is still more action(s) to do after the action in "Log" is done, according to the instruction. If so, set this field to true. Otherwise, set it to false.
649
649
"action":
@@ -659,7 +659,7 @@ For example, when the instruction is "click 'Confirm' button, and click 'Yes' in
659
659
this and output the JSON:
660
660
661
661
{
662
-
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, now i should use action 'Tap' to click 'Yes' in popup.",
662
+
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, next step is to tap the 'Yes' button in the popup. Now i am going to compose an action 'Tap' to click 'Yes' in popup.",
663
663
"action": {
664
664
"type": "Tap",
665
665
"param": {
@@ -715,7 +715,7 @@ Field description:
715
715
716
716
Return in JSON format:
717
717
{
718
-
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The typical log looks like "The user wants to do ... . According to the instruction and the previous logs, now i should use action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
718
+
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The log should contain the following information: "The user wants to do ... . According to the instruction and the previous logs, next step is to .... Now i am going to compose an action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
719
719
"error"?:string, // Error messages about unexpected situations, if any. Only think it is an error when the situation is not foreseeable according to the instruction. Use the same language as the user's instruction.
720
720
"more_actions_needed_by_instruction": boolean, // Consider if there is still more action(s) to do after the action in "Log" is done, according to the instruction. If so, set this field to true. Otherwise, set it to false.
721
721
"action":
@@ -731,7 +731,7 @@ For example, when the instruction is "click 'Confirm' button, and click 'Yes' in
731
731
this and output the JSON:
732
732
733
733
{
734
-
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, now i should use action 'Tap' to click 'Yes' in popup.",
734
+
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, next step is to tap the 'Yes' button in the popup. Now i am going to compose an action 'Tap' to click 'Yes' in popup.",
735
735
"action": {
736
736
"type": "Tap",
737
737
"param": {
@@ -787,7 +787,7 @@ Field description:
787
787
788
788
Return in JSON format:
789
789
{
790
-
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The typical log looks like "The user wants to do ... . According to the instruction and the previous logs, now i should use action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
790
+
"log": string, // Log your thoughts and what the next one action (ONLY ONE!) you can do according to the screenshot and the instruction. The log should contain the following information: "The user wants to do ... . According to the instruction and the previous logs, next step is to .... Now i am going to compose an action '{ action-type }' to do ....". If no action should be done, log the reason. Use the same language as the user's instruction.
791
791
"error"?:string, // Error messages about unexpected situations, if any. Only think it is an error when the situation is not foreseeable according to the instruction. Use the same language as the user's instruction.
792
792
"more_actions_needed_by_instruction": boolean, // Consider if there is still more action(s) to do after the action in "Log" is done, according to the instruction. If so, set this field to true. Otherwise, set it to false.
793
793
"action":
@@ -803,7 +803,7 @@ For example, when the instruction is "click 'Confirm' button, and click 'Yes' in
803
803
this and output the JSON:
804
804
805
805
{
806
-
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, now i should use action 'Tap' to click 'Yes' in popup.",
806
+
"log": "The user wants to do click 'Confirm' button, and click 'Yes' in popup. According to the instruction and the previous logs, next step is to tap the 'Yes' button in the popup. Now i am going to compose an action 'Tap' to click 'Yes' in popup.",
0 commit comments