diff --git a/docs/assets/actions.png b/docs/assets/actions.png new file mode 100644 index 00000000..e5885cde Binary files /dev/null and b/docs/assets/actions.png differ diff --git a/docs/docs/learn/actions.md b/docs/docs/learn/actions.md index dc875b36..f9e37d7e 100644 --- a/docs/docs/learn/actions.md +++ b/docs/docs/learn/actions.md @@ -1,5 +1,21 @@ +# Action objects +Trajectories objects will always contain a list of `Action objects`, which provide information about each action generated and executed by an agent, as well as all the information needed to replay these actions. +![action chain](https://raw.githubusercontent.com/lavague-ai/LaVague/drafting-some-docs/docs/assets/actions.png) + +## Navigation actions + +In the case of web navigation, an agent will generate an action based on a pre-defined list of possible actions. The action is provided as a string following a JSON format with all the key-pair arguments needed to easily parse and perform navigation actions. + +```json +action: + args: + xpath: "/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/a" + name: "click" +``` + +Here is a list of the current possible actions an agent can perform and the arguments required for this action: | Name | Arguments | Description | Engine | |-------------------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------|--------------------| @@ -13,8 +29,5 @@ | SCROLL_UP | none | Scrolls the browser window up. | NavigationControl | | WAIT | none | Pauses the operation for a set duration (e.g., 5 seconds). | NavigationControl | | BACK | none | Navigates back to the previous page. | NavigationControl | -| SCAN | none | Placeholder action, does nothing (pass). | NavigationControl | | MAXIMIZE_WINDOW | none | Maximizes the browser window. | NavigationControl | -| SWITCH_TAB | tab_id: number | Switches to a specific browser tab based on the tab_id provided. | NavigationControl | - - +| SWITCH_TAB | tab_id: number | Switches to a specific browser tab based on the tab_id provided. | NavigationControl | \ No newline at end of file