Commit Graph

345 Commits

Author SHA1 Message Date
Nick Sweeting
bfcd8a0140 make examples imports more consistent 2025-05-13 17:18:09 -07:00
Nick Sweeting
96682d8910 switch back from patchright to playwright until issues are resolved 2025-05-09 18:14:07 -07:00
2pac
384fc3fde0 chore: Bedrock optional dependencies 2025-05-05 21:39:48 +02:00
Nick Sweeting
23252192a0 remove non-functional group tabs code 2025-05-04 19:40:27 +08: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
4b1e15d8bd remove BrowserWindowContextSize in favor of window_width and window_height attrs 2025-05-03 15:32:42 +08:00
Nick Sweeting
2be4ba4f70 more pyupgrade changes 2025-05-02 20:50:21 +08:00
Nick Sweeting
66b3c26df5 add pyupgrade to lint rules 2025-05-02 15:21:23 +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
Nick Sweeting
fa461585f1 Merge pull request #1456 from Anirudha619/fix-test_vision 2025-04-26 02:28:04 -07:00
Anirudha619
2cea6aef79 run pre-commit 2025-04-25 23:42:23 +05:30
paul2048
e2abbe7f3c rename the Ollama example file 2025-04-22 14:24:36 +01:00
Nick Sweeting
ca8aed227a Merge branch 'main' into chore/replace-playwright-with-patchright 2025-04-22 01:58:45 -07:00
lynn
192b42ff79 chore: replace playwright with patchright 2025-04-22 15:43:01 +08: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
Nick Sweeting
8b165d5997 fix ruff errors in other files 2025-04-21 10:56:06 -07:00
Nick Sweeting
ae3bfadc0b Merge pull request #1424 from dha-aa/add-grok-model-docs-and-example 2025-04-21 10:12:31 -07: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
dha-aa
9fbfd91d28 add grok.py in examples/models 2025-04-19 00:09:37 +00:00
Daniel Fang
72f3d347fb Update azure_openai.py 2025-04-18 16:34:20 +10:00
Nick Sweeting
49ef4fca50 Merge branch 'main' into fix-web-voyager-example 2025-04-16 16:04:08 -07:00
Nick Sweeting
fd87ad3166 Merge pull request #1348 from azhengzz/fix-deepseek-expamle 2025-04-16 14:59:05 -07:00
Jason
25bfd67c17 fix: fix novita environment variable 2025-04-16 21:55:49 +08:00
Jason
45dc23caf4 fix: remove NOVITA_API_KEY env 2025-04-16 18:21:12 +08:00
Jason
627ff228a3 Merge branch 'main' into feat/novita 2025-04-16 15:09:29 +08:00
Jason
2f8e78a900 feat: add example and docs for Novita AI 2025-04-16 15:09:11 +08:00
阿正
3948ec9d93 Merge branch 'main' into fix-deepseek-expamle 2025-04-15 13:50:15 +08:00
Gregor Žunič
facab7c9d1 Merge branch 'main' into gregor/lib-53-fix-extraction-layer-problems 2025-04-14 11:15:01 +02:00
zhangzheng
7bae8509e3 Fix: Replace ChatOpenAI with ChatDeepSeek 2025-04-11 18:04:38 +08:00
Ulrich Soeffing
95ff962981 Update comment on how LLM is configured 2025-04-10 22:27:20 -04:00
Ulrich Soeffing
a7685d3e30 Fix web_voyager_agent.py example 2025-04-10 22:14:06 -04:00
Deshraj Yadav
27ec836491 Upgrade mem0 version 2025-04-09 18:51:44 -07:00
Gregor Žunič
ef55e2ea13 much better extraction test 2025-04-07 00:50:55 +02:00
Gregor Žunič
27b22a3986 Update extraction branch (#1296)
* Add http_credentials to browser context.

* Detect index change caused by page change in `multi_act`

* Fix: Add sameSite cookie validation and auto-correction

* added drag drop action

* added drag drop action

* pre-commit run -a (again)

* added active_tab state management

* add anthropic RateLimitError to list of defined rate limit errors

* Add Retry handling to bedrock example

* fix pydantic issue causing config to be overwritten

* fix config setup

* Add botocore, organize imports

* ignore langchain beta warnings

* silence pydantic deprecation warnings

* Update bedrock_claude for ruff

* ruff checks

* Update pyproject.toml and bedrock_claude.py

* ignore signal registration errors in edge case environments

* ruff fixes

* add example of getting 2FA code from 1password

* add rebrowser and creepjs to stealth tests

* Fix typos discovered by codespell

* uv add --dev codespell

* Update browser_use/browser/context.py

* lint

* Add explanations override_system_message and extend_system_message

* Update custom-functions.mdx

.get_current_page() is an async function which have to be awaited.

* Fix: Remove unnecessary await from _verified_api_keys

* Fix: Correct indentation for cookie loading log message in BrowserContext

* Fix: resolve undefined response variable in Deepseek model raw tool calling mode

* fix: increment consecutive_failure on every step error

* Fix azure example not working due to agent memory changes

* dont expose debug port on all addresses and keep security enabled by default

* custom browser addition

---------

Co-authored-by: Bartlomiej Wietrak <bartekwietrak@gmail.com>
Co-authored-by: Alin Jiang <alineveryday@outlook.com>
Co-authored-by: dipfocus <dipfocus@gmail.com>
Co-authored-by: PaperBoardOfficial <hiremohitforsoftwarerole@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Alezander9 <alexander.j.yue@gmail.com>
Co-authored-by: dheerajoruganty <db2winfb@gmail.com>
Co-authored-by: Nick Sweeting <git@sweeting.me>
Co-authored-by: Dheeraj Oruganty <53569374+dheerajoruganty@users.noreply.github.com>
Co-authored-by: Bart <46058081+b0rgcube@users.noreply.github.com>
Co-authored-by: Nick Sweeting <github@sweeting.me>
Co-authored-by: pppp606 <ppppp303@gmail.com>
Co-authored-by: Oswy <74738120+oswy-cpu@users.noreply.github.com>
Co-authored-by: BurnyCoder <happymancz@email.cz>
Co-authored-by: zhushijie <mr.zhushijie@gmail.com>
Co-authored-by: john-rtr <jonathan.ratier@gmail.com>
Co-authored-by: mathisarends-viadee <mathis.arends@viadee.de>
Co-authored-by: lorenss-m <saeclmusic@gmail.com>
Co-authored-by: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
2025-04-05 19:08:50 +02:00
mathisarends-viadee
2e265e8388 Fix azure example not working due to agent memory changes 2025-04-03 16:07:55 +02: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
Nick Sweeting
c6525d57e3 add rebrowser and creepjs to stealth tests 2025-03-30 18:43:10 -07:00
Nick Sweeting
bf1afd9422 add example of getting 2FA code from 1password 2025-03-30 16:23:53 -07:00
dheerajoruganty
9c1101fe0c Update pyproject.toml and bedrock_claude.py 2025-03-30 15:21:34 -07:00
dheerajoruganty
3108d5b81d ruff checks 2025-03-30 15:00:01 -07:00
dheerajoruganty
e0d6d838a7 Update bedrock_claude for ruff 2025-03-30 14:57:58 -07:00