functionaiAction(steps:string):Promise<void>;functionai(steps:string):Promise<void>;// shorthand form
Examples:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Basic usage
awaitagent.aiAction('Type "JavaScript" into the search box, then click the search button')// Using the shorthand .ai form
awaitagent.ai('Click the login button at the top of the page, then enter "test@example.com" in the username field')// Complex example of target-oriented prompts from the ui-tars model
// Other models recommend writing the execution steps for each step
awaitagent.aiAction(`
1. Scroll to the product list
2. Locate the "Sauce Labs Backpack" item
3. Click its "Add to cart" button
4. Wait for the shopping cart icon to update
`)
constdataA=awaitagent.aiQuery({time:'The date and time displayed in the top-left corner as a string',userInfo:'User information in the format {name: string}',tableFields:'An array of table field names, string[]',tableDataRecord:'Table records in the format {id: string, [fieldName]: string}[]',})// You can also describe the expected return format using a string:
// dataB will be an array of strings
constdataB=awaitagent.aiQuery('string[], list of task names')// dataC will be an array of objects
constdataC=awaitagent.aiQuery('{name: string, age: string}[], table data records')