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

workflow(ci): fix ai test error #113

Merged
merged 5 commits into from
Oct 12, 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
1 change: 1 addition & 0 deletions packages/midscene/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"test": "vitest --run",
"test:ai": "AITEST=true npm run test",
"evaluate": "npm run test:ai -- tests/ai/evaluate/inspect.test.ts",
"evaluate:update": "UPDATE_AI_DATA=true npm run test:ai -- tests/ai/evaluate/inspect.test.ts",
"evaluate:plan": "PLAN_INSPECT=true npm run test:ai -- tests/ai/evaluate/inspect.test.ts",
"prepublishOnly": "npm run build"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/midscene/src/ai-model/prompt/element_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Please return the result in JSON format as follows:
{
"reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
"text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
"id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
"id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo, important: use id not indexId
}
// More elements...
],
Expand Down Expand Up @@ -79,7 +79,7 @@ Input Example:
},
{
"id": "wefew2222few2", // ID of the element
"indexId": "1", // Index of the elementThe image is labeled to the left of the element
"indexId": "1", // Index of the element,The image is labeled to the left of the element
"attributes": { // Attributes of the element
"nodeType": "IMG Node", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node
"src": "data:image/png;base64,iVBORw0KGgoAAAANSU...",
Expand Down Expand Up @@ -127,7 +127,7 @@ Output Example:
// Describe the reason for finding this element, replace with actual value in practice
"reason": "Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button",
"text": "",
// ID of this element, replace with actual value in practice
// ID(hashID) of this element, replace with actual value in practice, important: use id not indexId
"id": "wefew2222few2"
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/midscene/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export { plan } from './ai-model';

export * from './types';
export default Insight;
export { getElement, getSection, Executor, setLogDir };
export { getElement, getSection, Executor, setLogDir, Insight };
Loading
Loading