123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- // This is the json schema exported from browser-use, change page_id to tab_id
- // TODO: don't know why zod can not generate the same schema, need to fix it
- export const jsonNavigatorOutputSchema = {
- $defs: {
- ActionModel: {
- properties: {
- done: {
- anyOf: [
- {
- $ref: '#/$defs/DoneAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Complete task',
- },
- search_google: {
- anyOf: [
- {
- $ref: '#/$defs/SearchGoogleAction',
- },
- {
- type: 'null',
- },
- ],
- description:
- 'Search the query in Google in the current tab, the query should be a search query like humans search in Google, concrete and not vague or super long. More the single most important items. ',
- },
- go_to_url: {
- anyOf: [
- {
- $ref: '#/$defs/GoToUrlAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Navigate to URL in the current tab',
- },
- go_back: {
- anyOf: [
- {
- $ref: '#/$defs/NoParamsAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Go back',
- },
- click_element: {
- anyOf: [
- {
- $ref: '#/$defs/ClickElementAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Click element',
- },
- input_text: {
- anyOf: [
- {
- $ref: '#/$defs/InputTextAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Input text into a input interactive element',
- },
- switch_tab: {
- anyOf: [
- {
- $ref: '#/$defs/SwitchTabAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Switch tab',
- },
- open_tab: {
- anyOf: [
- {
- $ref: '#/$defs/OpenTabAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Open url in new tab',
- },
- cache_content: {
- anyOf: [
- {
- $ref: '#/$defs/cache_content_parameters',
- },
- {
- type: 'null',
- },
- ],
- description: 'Cache what you have found so far from the current page so that it can be used in future steps',
- },
- scroll_down: {
- anyOf: [
- {
- $ref: '#/$defs/ScrollAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Scroll down the page by pixel amount - if no amount is specified, scroll down one page',
- },
- scroll_up: {
- anyOf: [
- {
- $ref: '#/$defs/ScrollAction',
- },
- {
- type: 'null',
- },
- ],
- description: 'Scroll up the page by pixel amount - if no amount is specified, scroll up one page',
- },
- send_keys: {
- anyOf: [
- {
- $ref: '#/$defs/SendKeysAction',
- },
- {
- type: 'null',
- },
- ],
- description:
- 'Send strings of special keys like Backspace, Insert, PageDown, Delete, Enter, Shortcuts such as `Control+o`, `Control+Shift+T` are supported as well. This gets used in keyboard.press. Be aware of different operating systems and their shortcuts',
- },
- scroll_to_text: {
- anyOf: [
- {
- $ref: '#/$defs/scroll_to_text_parameters',
- },
- {
- type: 'null',
- },
- ],
- description: 'If you dont find something which you want to interact with, scroll to it',
- },
- get_dropdown_options: {
- anyOf: [
- {
- $ref: '#/$defs/get_dropdown_options_parameters',
- },
- {
- type: 'null',
- },
- ],
- description: 'Get all options from a native dropdown',
- },
- select_dropdown_option: {
- anyOf: [
- {
- $ref: '#/$defs/select_dropdown_option_parameters',
- },
- {
- type: 'null',
- },
- ],
- description:
- 'Select dropdown option for interactive element index by the text of the option you want to select',
- },
- },
- title: 'ActionModel',
- type: 'object',
- },
- AgentBrain: {
- description: 'Current state of the agent',
- properties: {
- page_summary: {
- title: 'Page Summary',
- type: 'string',
- },
- evaluation_previous_goal: {
- title: 'Evaluation Previous Goal',
- type: 'string',
- },
- memory: {
- title: 'Memory',
- type: 'string',
- },
- next_goal: {
- title: 'Next Goal',
- type: 'string',
- },
- },
- required: ['page_summary', 'evaluation_previous_goal', 'memory', 'next_goal'],
- title: 'AgentBrain',
- type: 'object',
- },
- ClickElementAction: {
- properties: {
- desc: {
- title: 'Intent',
- type: 'string',
- description: 'Very short explanation of the intent or purpose for calling this action',
- },
- index: {
- title: 'Index',
- type: 'integer',
- },
- xpath: {
- anyOf: [
- {
- type: 'string',
- },
- {
- type: 'null',
- },
- ],
- title: 'Xpath',
- },
- },
- required: ['desc', 'index'],
- title: 'ClickElementAction',
- type: 'object',
- },
- DoneAction: {
- properties: {
- text: {
- title: 'Text',
- type: 'string',
- },
- },
- required: ['text'],
- title: 'DoneAction',
- type: 'object',
- },
- GoToUrlAction: {
- properties: {
- url: {
- title: 'Url',
- type: 'string',
- },
- },
- required: ['url'],
- title: 'GoToUrlAction',
- type: 'object',
- },
- InputTextAction: {
- properties: {
- desc: {
- title: 'Intent',
- type: 'string',
- description: 'Very short explanation of the intent or purpose for calling this action',
- },
- index: {
- title: 'Index',
- type: 'integer',
- },
- text: {
- title: 'Text',
- type: 'string',
- },
- xpath: {
- anyOf: [
- {
- type: 'string',
- },
- {
- type: 'null',
- },
- ],
- title: 'Xpath',
- },
- },
- required: ['desc', 'index', 'text'],
- title: 'InputTextAction',
- type: 'object',
- },
- NoParamsAction: {
- additionalProperties: true,
- description:
- 'Accepts absolutely anything in the incoming data\nand discards it, so the final parsed model is empty.',
- properties: {},
- title: 'NoParamsAction',
- type: 'object',
- },
- OpenTabAction: {
- properties: {
- url: {
- title: 'Url',
- type: 'string',
- },
- },
- required: ['url'],
- title: 'OpenTabAction',
- type: 'object',
- },
- ScrollAction: {
- properties: {
- desc: {
- title: 'Intent',
- type: 'string',
- description: 'Very short explanation of the intent or purpose for calling this action',
- },
- amount: {
- anyOf: [
- {
- type: 'integer',
- },
- {
- type: 'null',
- },
- ],
- title: 'Amount',
- },
- },
- required: ['desc'],
- title: 'ScrollAction',
- type: 'object',
- },
- SearchGoogleAction: {
- properties: {
- query: {
- title: 'Query',
- type: 'string',
- },
- },
- required: ['query'],
- title: 'SearchGoogleAction',
- type: 'object',
- },
- SendKeysAction: {
- properties: {
- desc: {
- title: 'Intent',
- type: 'string',
- description: 'Very short explanation of the intent or purpose for calling this action',
- },
- keys: {
- title: 'Keys',
- type: 'string',
- },
- },
- required: ['desc', 'keys'],
- title: 'SendKeysAction',
- type: 'object',
- },
- SwitchTabAction: {
- properties: {
- tab_id: {
- title: 'Page Id',
- type: 'integer',
- },
- },
- required: ['tab_id'],
- title: 'SwitchTabAction',
- type: 'object',
- },
- cache_content_parameters: {
- properties: {
- content: {
- title: 'Content',
- type: 'string',
- },
- },
- required: ['content'],
- title: 'cache_content_parameters',
- type: 'object',
- },
- get_dropdown_options_parameters: {
- properties: {
- index: {
- title: 'Index',
- type: 'integer',
- },
- },
- required: ['index'],
- title: 'get_dropdown_options_parameters',
- type: 'object',
- },
- scroll_to_text_parameters: {
- properties: {
- desc: {
- title: 'Intent',
- type: 'string',
- description: 'Very short explanation of the intent or purpose for calling this action',
- },
- text: {
- title: 'Text',
- type: 'string',
- },
- },
- required: ['desc', 'text'],
- title: 'scroll_to_text_parameters',
- type: 'object',
- },
- select_dropdown_option_parameters: {
- properties: {
- index: {
- title: 'Index',
- type: 'integer',
- },
- text: {
- title: 'Text',
- type: 'string',
- },
- },
- required: ['index', 'text'],
- title: 'select_dropdown_option_parameters',
- type: 'object',
- },
- },
- properties: {
- current_state: {
- $ref: '#/$defs/AgentBrain',
- },
- action: {
- items: {
- $ref: '#/$defs/ActionModel',
- },
- title: 'Action',
- type: 'array',
- },
- },
- required: ['current_state', 'action'],
- title: 'AgentOutput',
- type: 'object',
- };
|