-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replanning before locating (#167)
- Loading branch information
1 parent
515639f
commit 082e347
Showing
120 changed files
with
5,422 additions
and
4,928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,32 @@ The natural language parameter passed to Midscene will be part of the prompt sen | |
|
||
Since AI has the nature of heuristic, the purpose of prompt tuning should be to obtain stable responses from the AI model across runs. In most cases, to expect a consistent response from LLM by using a good prompt is entirely feasible. | ||
|
||
## Detailed descriptions and samples are welcome | ||
## Use detailed descriptions and samples | ||
|
||
Detailed descriptions and examples are always welcome. | ||
|
||
For example: | ||
|
||
Bad ❌: "Search 'headphone'" | ||
|
||
Good ✅: "Find the search box (it should be along with a region switch, such as 'domestic' or 'international'), type 'headphone', and hit Enter." | ||
Good ✅: "Click the search box (it should be along with a region switch, such as 'domestic' or 'international'), type 'headphone', and hit Enter." | ||
|
||
Bad ❌: "Assert: food delivery service is in normal state" | ||
|
||
Good ✅: "Assert: There is a 'food delivery service' on page, and is in normal state" | ||
|
||
## One prompt should only do one thing | ||
|
||
Use `.ai` each time to do one task. Although Midscene has an auto-replanning strategy, it's still preferable to keep the prompt concise. Otherwise the LLM output will likely be messy. The token cost between a long prompt and a short prompt is almost the same. | ||
|
||
Bad ❌: "Click Login button, then click Sign up button, fill the form with '[email protected]' in the email field, 'test' in the password field, and click Sign up button" | ||
|
||
Good ✅: Split the task into three steps: | ||
|
||
"Click Login Button" | ||
"Click Sign up button" | ||
"Fill the form with '[email protected]' in the email field, 'test' in the password field, and click Sign up button" | ||
|
||
## LLMs can NOT tell the exact number like coords or hex-style color, give it some choices | ||
|
||
For example: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,18 @@ | |
|
||
正确示例 ✅: "断言:界面上有个“外卖服务”的板块,并且标识着“正常”" | ||
|
||
## 一个 Prompt (指令)只做一件事 | ||
|
||
使用 `.ai` 每次只做一件事。尽管 Midscene 有自动重规划能力,但仍应保持指令简洁。否则,LLM 的输出可能会变得混乱。指令的长度对 token 消耗的影响几乎可以忽略不计。 | ||
|
||
错误示例 ❌: "点击登录按钮,然后点击注册按钮,在表单中输入'[email protected]'作为邮箱,'test'作为密码,然后点击注册按钮" | ||
|
||
正确示例 ✅: 将任务分解为三个步骤: | ||
|
||
"点击登录按钮" | ||
"点击注册按钮" | ||
"在表单中输入'[email protected]'作为邮箱,'test'作为密码,然后点击注册按钮" | ||
|
||
### LLM 无法准确辨别数值(比如坐标或十六进制颜色值),不妨提供一些选项 | ||
|
||
例如: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.