Skip to content

Commit

Permalink
fix(html-extract): optimize the logic for extracting HTML content to …
Browse files Browse the repository at this point in the history
…improve extraction accuracy (#62)

* chore: optimize extract logic

* chore: fix word type error

* chore: optimize build error

* chore: optimize generate test data

* chore: optimize generate test data
  • Loading branch information
zhoushaw authored Aug 21, 2024
1 parent 6553da1 commit bc85f7c
Show file tree
Hide file tree
Showing 25 changed files with 1,388 additions and 3,045 deletions.
2 changes: 1 addition & 1 deletion packages/midscene/src/ai-model/automation/planning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function systemPromptToTaskPlanning() {
1. The actions you composed MUST be based on the page context information you get. Instead of making up actions that are not related to the page context.
2. In most cases, you should Locate one element first, then do other actions on it. For example, alway Find one element, then hover on it. But if you think it's necessary to do other actions first (like global scroll, global key press), you can do that.
If the planned tasks are sequential and tasks may appear only after the execution of previous tasks, this is considered normal. If any errors occur during task planning (such as the page content being irrelevant to the task or the mentioned element not existing), please return the error message with an explanation in the errors field. Thoughts, prompts, and error messages should all be in the same language as the user query.
If the planned tasks are sequential and tasks may appear only after the execution of previous tasks, this is considered normal. Thoughts, prompts, and error messages should all be in the same language as the user query.
Return in the following JSON format:
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`automation - planning > basic run 1`] = `
{
"timeMs": 3500,
}
`;

exports[`automation - planning > basic run 2`] = `
{
"value": "Enter",
}
`;

exports[`automation - planning coze > basic run 1`] = `
{
"timeMs": 3500,
}
`;

exports[`automation - planning coze > basic run 2`] = `
{
"value": "Enter",
}
`;

exports[`automation - planning openAI > basic run 1`] = `
{
"timeMs": 3500,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`assert coze > todo 1`] = `
{
"data": [
"Learn Python",
"Learn Rust",
"Learn AI",
],
"errors": [],
"language": "en",
}
`;

exports[`assert coze > todo obj 1`] = `
{
"data": [
{
"checked": false,
"text": "Learn Python",
},
{
"checked": false,
"text": "Learn Rust",
},
{
"checked": false,
"text": "Learn AI",
},
],
"errors": [],
"language": "en",
}
`;

exports[`assert openAI > online order 1`] = `
{
"data": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"elements": [
{
"id": "ba59909699",
"id": "e666c51ff8",
"indexId": "2",
},
],
Expand Down Expand Up @@ -46,11 +46,11 @@
{
"elements": [
{
"id": "580cfae23c",
"id": "fadfa10182",
"indexId": "23",
},
{
"id": "925c254744",
"id": "001617dbf8",
"indexId": "29",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"elements": [
{
"id": "b5bacc879a",
"id": "e477ad490a",
"indexId": "8",
},
],
Expand Down Expand Up @@ -42,7 +42,7 @@
{
"elements": [
{
"id": "0f8f471e06",
"id": "284ba7f2b3",
"indexId": "15",
},
],
Expand Down

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bc85f7c

Please sign in to comment.