Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(html-extract): optimize the logic for extracting HTML content to improve extraction accuracy #62

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading