Commit Graph

59 Commits

Author SHA1 Message Date
Nick Sweeting
bfcd8a0140 make examples imports more consistent 2025-05-13 17:18:09 -07:00
Nick Sweeting
d08b402101 finish updating last few locations where nested window_size was used 2025-05-04 00:29:29 +08:00
Nick Sweeting
2be4ba4f70 more pyupgrade changes 2025-05-02 20:50:21 +08:00
RogelioRichmanAstronaut
0e5c676504 fix: Apply pre-commit linting fixes and improve Playwright example script execution
- Applied automated linting suggestions from pre-commit hooks, primarily updating type hints (e.g., Dict -> dict) and organizing imports.
- Refactored Playwright script execution in examples/features/playwright_script_generation.py to use asyncio.create_subprocess_exec for asynchronous handling and real-time log streaming, resolving ASYNC221 lint error and improving output visibility.
2025-04-30 00:05:36 -05:00
Nick Sweeting
51f09b85aa Merge branch 'main' into feat/playwright-script-generation 2025-04-28 20:11:41 -07:00
Christian Clauss
0f0d7b5c39 await asyncio.sleep(0.1) 2025-04-22 08:46:34 +02:00
Christian Clauss
fc59265654 ruff rule FAST002 FastAPI dependency without 'Annotated' 2025-04-22 08:10:49 +02:00
Nick Sweeting
02fb682d04 Merge pull request #1310 from cclauss/ruff_check_--select=ASYNC 2025-04-21 15:10:57 -07:00
Nick Sweeting
a34d201eb4 simplify warning messages for bad API keys 2025-04-21 14:52:11 -07:00
Nick Sweeting
1cf4104ed3 fix async errors in features/pause_agent.py 2025-04-21 14:27:36 -07:00
Christian Clauss
fb3282527d Detect blocking synchronous commands in asyncio code 2025-04-21 22:30:43 +02:00
RogelioRichmanAstronaut
71400d93e6 feat: Add Playwright script generation from agent history
Implement the ability to generate executable Playwright scripts from an Agent's run history (`AgentHistoryList`).

This introduces the `PlaywrightScriptGenerator` class which translates recorded agent actions (clicks, inputs, navigation, etc.) into a Python script using Playwright's async API.

Key features:
- Uses XPath selectors derived from the agent's interaction history.
- Includes a robust helper function (`_try_locate_and_act`) with XPath prefix trimming for improved resilience on dynamic pages.
- Handles sensitive data placeholders by mapping them to environment variables in the generated script.
- Supports configuring the browser launch and context based on the original agent's `BrowserConfig` and `BrowserContextConfig`.
- Activated by setting the `save_playwright_script_path` option in `AgentSettings`.

Includes modifications to `Agent` service to trigger generation and `AgentHistoryList` view to add the saving method. Also adds a new example (`examples/features/playwright_script_generation.py`).

This feature enables reliable replay of agent runs, automated testing, and scripting of repetitive tasks discovered by the agent.
2025-04-21 11:05:06 -05:00
PaperBoardOfficial
ae4a423e3d lint 2025-04-01 08:14:15 +05:30
Nick Sweeting
298db41c4a Merge branch 'main' into drag_drop 2025-03-31 19:33:28 -07:00
PaperBoardOfficial
9f8218f556 resolved merge conflicts 2025-03-31 16:49:26 +05:30
Christian Clauss
e7c3f43808 Fix typos discovered by codespell 2025-03-31 07:47:56 +02:00
Deshraj Yadav
056dbe20e3 Add example and minor improvements 2025-03-29 17:24:21 -07:00
PaperBoardOfficial
6f96453794 added drag drop action 2025-03-29 11:01:09 +05:30
Nick Sweeting
fb6fa259a8 apply ruff safe fixes 2025-03-28 18:11:36 -07:00
Nick Sweeting
226eb99a4f Merge branch 'main' into ruff-linting 2025-03-28 15:44:47 -07:00
Nick Sweeting
e2e278da95 fix syntax errors 2025-03-28 15:39:31 -07:00
Nick Sweeting
ec56bfe81b run ruff on the entire codebase 2025-03-28 01:22:48 -07:00
Nick Sweeting
cec5b687fb fix browser_window_size config 2025-03-27 11:45:25 -07:00
Nick Sweeting
e6900d1287 add ruff dependency 2025-03-27 11:10:41 -07:00
Nick Sweeting
69a960fa4b refactor browser config setup process 2025-03-27 02:45:12 -07:00
Nick Sweeting
ff14e42b83 user profile is managed by plawright instead of flags 2025-03-27 02:43:45 -07:00
Nick Sweeting
b47c20c780 Merge branch 'main' into Click-on-non-indexed-elements 2025-03-26 16:50:35 -07:00
Nick Sweeting
aa6e62b0d2 fix for follow_up_tasks example 2025-03-26 14:45:01 -07:00
Jeff Andrade
0e5e108e10 Merge branch 'browser-use:main' into Click-on-non-indexed-elements 2025-03-26 09:37:09 +00:00
jersobh
4a201f4c69 handling multiple elements with the same text 2025-03-26 02:53:14 +00:00
Nick Sweeting
8770a5e602 simplify test task 2025-03-24 17:08:38 -07:00
Nick Sweeting
dd7fb8a11d tweak salesforce test cross-origin iframe task 2025-03-24 14:28:40 -07:00
Nick Sweeting
2da5a833a9 tweak llm-facing title for new tabs and improve logging 2025-03-24 11:25:54 -07:00
jersobh
63f54cc100 Clicking by xpath, css selector or text 2025-03-24 12:34:01 +00:00
Nick Sweeting
421ecd597f Merge branch 'main' into nick/tri-4-make-cross-site-iframes-work-without-disabling-chrome 2025-03-23 00:52:33 -07:00
Nick Sweeting
78ade39821 wip trying different approaches, not final 2025-03-23 00:20:12 -07:00
Edison S
fb22cc5a99 add multibrowser support 2025-03-05 13:32:03 -05:00
Magnus Müller
2a6416f272 Add flexible system prompt customization options
- Modify SystemPrompt class to support optional system message override and extension
- Update Agent and AgentSettings to include new system prompt customization parameters
- Update documentation and example to demonstrate new system prompt customization methods
- Remove deprecated system_prompt_class parameter
- Provide two ways to customize system prompt: extend or override completely
2025-02-23 12:25:33 -08:00
Magnus Müller
5611ce8b49 Delete examples 2025-02-18 12:51:25 -08:00
Matic Zavadlal
e8b1852ac1 Create context.py 2025-02-16 17:30:16 +01:00
Matic Zavadlal
af76a92570 stash 2025-02-14 21:55:20 +01:00
Matic Zavadlal
5bd9ed2731 stash 2025-02-14 18:56:57 +01:00
Gregor Žunič
ded606a233 outsource state 2025-02-13 22:32:18 -08:00
Gregor Žunič
aa19548eff outsourced state v1 2025-02-13 21:48:00 -08:00
Asten
4fda95d560 Remove unnecessary import statements 2025-02-08 14:38:51 +08:00
magmueller
98f159e8b4 Planner with deepseek 2025-02-04 21:41:09 -08:00
magmueller
90f949a72b Planner update prompt 2025-02-04 16:32:58 -08:00
magmueller
b88c177d1c Added planer to comine gpt4o with o3 mini 2025-02-03 14:17:38 -08:00
magmueller
0e107dc5d1 Check for pause more often 2025-02-01 18:33:44 -08:00
magmueller
46632d6435 Reorder example 2025-02-01 18:04:45 -08:00