json_schema.ts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. // This is the json schema exported from browser-use, change page_id to tab_id
  2. // TODO: don't know why zod can not generate the same schema, need to fix it
  3. export const jsonNavigatorOutputSchema = {
  4. properties: {
  5. current_state: {
  6. description: 'Current state of the agent',
  7. properties: {
  8. page_summary: {
  9. title: 'Page Summary',
  10. type: 'string',
  11. },
  12. evaluation_previous_goal: {
  13. title: 'Evaluation Previous Goal',
  14. type: 'string',
  15. },
  16. memory: {
  17. title: 'Memory',
  18. type: 'string',
  19. },
  20. next_goal: {
  21. title: 'Next Goal',
  22. type: 'string',
  23. },
  24. },
  25. required: ['page_summary', 'evaluation_previous_goal', 'memory', 'next_goal'],
  26. title: 'AgentBrain',
  27. type: 'object',
  28. },
  29. action: {
  30. items: {
  31. properties: {
  32. done: {
  33. properties: {
  34. text: {
  35. title: 'Text',
  36. type: 'string',
  37. },
  38. },
  39. required: ['text'],
  40. title: 'DoneAction',
  41. type: 'object',
  42. nullable: true,
  43. },
  44. search_google: {
  45. properties: {
  46. query: {
  47. title: 'Query',
  48. type: 'string',
  49. },
  50. },
  51. required: ['query'],
  52. title: 'SearchGoogleAction',
  53. type: 'object',
  54. nullable: true,
  55. },
  56. go_to_url: {
  57. properties: {
  58. url: {
  59. title: 'Url',
  60. type: 'string',
  61. },
  62. },
  63. required: ['url'],
  64. title: 'GoToUrlAction',
  65. type: 'object',
  66. nullable: true,
  67. },
  68. go_back: {
  69. additionalProperties: true,
  70. description:
  71. 'Accepts absolutely anything in the incoming data\nand discards it, so the final parsed model is empty.',
  72. properties: {},
  73. title: 'NoParamsAction',
  74. type: 'object',
  75. nullable: true,
  76. },
  77. click_element: {
  78. properties: {
  79. desc: {
  80. title: 'Intent',
  81. type: 'string',
  82. description: 'Very short explanation of the intent or purpose for calling this action',
  83. },
  84. index: {
  85. title: 'Index',
  86. type: 'integer',
  87. },
  88. xpath: {
  89. title: 'XPath',
  90. type: 'string',
  91. nullable: true,
  92. },
  93. },
  94. required: ['desc', 'index'],
  95. title: 'ClickElementAction',
  96. type: 'object',
  97. nullable: true,
  98. },
  99. input_text: {
  100. properties: {
  101. desc: {
  102. title: 'Intent',
  103. type: 'string',
  104. description: 'Very short explanation of the intent or purpose for calling this action',
  105. },
  106. index: {
  107. title: 'Index',
  108. type: 'integer',
  109. },
  110. text: {
  111. title: 'Text',
  112. type: 'string',
  113. },
  114. xpath: {
  115. title: 'XPath',
  116. type: 'string',
  117. nullable: true,
  118. },
  119. },
  120. required: ['desc', 'index', 'text'],
  121. title: 'InputTextAction',
  122. type: 'object',
  123. nullable: true,
  124. },
  125. switch_tab: {
  126. properties: {
  127. tab_id: {
  128. title: 'Page Id',
  129. type: 'integer',
  130. },
  131. },
  132. required: ['tab_id'],
  133. title: 'SwitchTabAction',
  134. type: 'object',
  135. nullable: true,
  136. },
  137. open_tab: {
  138. properties: {
  139. url: {
  140. title: 'Url',
  141. type: 'string',
  142. },
  143. },
  144. required: ['url'],
  145. title: 'OpenTabAction',
  146. type: 'object',
  147. nullable: true,
  148. },
  149. cache_content: {
  150. properties: {
  151. content: {
  152. title: 'Content',
  153. type: 'string',
  154. },
  155. },
  156. required: ['content'],
  157. title: 'cache_content_parameters',
  158. type: 'object',
  159. nullable: true,
  160. },
  161. scroll_down: {
  162. properties: {
  163. desc: {
  164. title: 'Intent',
  165. type: 'string',
  166. description: 'Very short explanation of the intent or purpose for calling this action',
  167. },
  168. amount: {
  169. title: 'Amount',
  170. type: 'integer',
  171. nullable: true,
  172. },
  173. },
  174. required: ['desc'],
  175. title: 'ScrollAction',
  176. type: 'object',
  177. nullable: true,
  178. },
  179. scroll_up: {
  180. properties: {
  181. desc: {
  182. title: 'Intent',
  183. type: 'string',
  184. description: 'Very short explanation of the intent or purpose for calling this action',
  185. },
  186. amount: {
  187. title: 'Amount',
  188. type: 'integer',
  189. nullable: true,
  190. },
  191. },
  192. required: ['desc'],
  193. title: 'ScrollAction',
  194. type: 'object',
  195. nullable: true,
  196. },
  197. send_keys: {
  198. properties: {
  199. desc: {
  200. title: 'Intent',
  201. type: 'string',
  202. description: 'Very short explanation of the intent or purpose for calling this action',
  203. },
  204. keys: {
  205. title: 'Keys',
  206. type: 'string',
  207. },
  208. },
  209. required: ['desc', 'keys'],
  210. title: 'SendKeysAction',
  211. type: 'object',
  212. nullable: true,
  213. },
  214. scroll_to_text: {
  215. properties: {
  216. desc: {
  217. title: 'Intent',
  218. type: 'string',
  219. description: 'Very short explanation of the intent or purpose for calling this action',
  220. },
  221. text: {
  222. title: 'Text',
  223. type: 'string',
  224. },
  225. },
  226. required: ['desc', 'text'],
  227. title: 'scroll_to_text_parameters',
  228. type: 'object',
  229. nullable: true,
  230. },
  231. get_dropdown_options: {
  232. properties: {
  233. index: {
  234. title: 'Index',
  235. type: 'integer',
  236. },
  237. },
  238. required: ['index'],
  239. title: 'get_dropdown_options_parameters',
  240. type: 'object',
  241. nullable: true,
  242. },
  243. select_dropdown_option: {
  244. properties: {
  245. index: {
  246. title: 'Index',
  247. type: 'integer',
  248. },
  249. text: {
  250. title: 'Text',
  251. type: 'string',
  252. },
  253. },
  254. required: ['index', 'text'],
  255. title: 'select_dropdown_option_parameters',
  256. type: 'object',
  257. nullable: true,
  258. },
  259. },
  260. title: 'ActionModel',
  261. type: 'object',
  262. },
  263. title: 'Action',
  264. type: 'array',
  265. },
  266. },
  267. required: ['current_state', 'action'],
  268. title: 'AgentOutput',
  269. type: 'object',
  270. };