Commit Graph

1537 Commits

Author SHA1 Message Date
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
Nick Sweeting ab859f4252 fix errant key 2025-04-21 14:17:32 -07:00
Nick Sweeting 590733da87 Merge branch 'main' into fix/1430/example-tool-call-click-action 2025-04-21 11:52:39 -07:00
Nick Sweeting a47c34d716 Merge pull request #1443 from Anirudha619/fix 2025-04-21 11:28:28 -07:00
Nick Sweeting 26d869c4f1 Merge branch 'main' into improve-eval-tool 2025-04-21 11:18:45 -07:00
Anirudha619 b43648b6ad Fix Error: 'AgentSettings' object has no attribute 'enable_memory' 2025-04-21 23:46:19 +05:30
Nick Sweeting 85586ef821 Merge branch 'main' into mathisarends-viadee/extend-system-prompt-for-planner-llm 2025-04-21 11:03:05 -07:00
Nick Sweeting 8b165d5997 fix ruff errors in other files 2025-04-21 10:56:06 -07:00
Nick Sweeting db54a6c8b3 fix vector_store_path duplication/inconsistency 2025-04-21 10:39:02 -07:00
Nick Sweeting d9f765dcac use new-style python types 2025-04-21 10:30:36 -07:00
Nick Sweeting ceb90db823 lazy import 2025-04-21 10:27:04 -07:00
Nick Sweeting d5ad80f5fd fix ruff errors with new memory PR 2025-04-21 10:24:33 -07:00
Nick Sweeting 738508d413 Merge branch 'main' into mathisarends-viadee/extend-system-prompt-for-planner-llm 2025-04-21 10:17:33 -07:00
Nick Sweeting 2b4397f1b8 Merge pull request #1417 from qkfang/azureopenai_env 2025-04-21 10:11:28 -07:00
Nick Sweeting b8859817b1 Merge pull request #834 from Shyanil/fix/439-max-steps-history 2025-04-21 09:58:57 -07:00
RogelioRichmanAstronaut fcd334246c Refactor: Use dictionary dispatch for Playwright action mapping
Refactored the `_map_action_to_playwright` method in `PlaywrightScriptGenerator` to address its excessive length and complexity stemming from numerous if/elif blocks.

Introduced a dictionary (`_action_handlers`) to map action type strings to dedicated private handler methods (e.g., `_map_go_to_url`, `_map_input_text`). The main `_map_action_to_playwright` method now delegates the call to the appropriate handler via this dictionary lookup.

This change significantly simplifies the main mapping logic, improves code readability, isolates action-specific logic, and makes the overall structure easier to maintain and extend. It directly resolves the concern about the method's length and error-proneness.
2025-04-21 11:58:55 -05:00
Nick Sweeting 1ac623f798 Merge pull request #857 from neo773/bot-detection-batch 2025-04-21 09:56:27 -07:00
Nick Sweeting ce584b0ca1 Merge pull request #1427 from zacka026/main 2025-04-21 09:54:11 -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
lynn b0e27f01fe fix: update example_tool_call to use click_element_by_index action 2025-04-21 16:32:52 +08:00
Dev-Khant 6b16855c11 Merge branch 'main' into fix-huggingface-issue 2025-04-20 11:55:47 +05:30
Zack A 9fbc669114 fix: update version retrieval method to use importlib.metadata 2025-04-19 08:38:17 -04:00
lynn 347b473ab7 fix: Make memory module optional for Python 3.13 compatibility 2025-04-18 14:54:48 +08:00
Daniel Fang 3657f0a3f5 Update views.py 2025-04-18 16:33:37 +10:00
Alezander9 057a69e298 feat: allow eval script to use any model for BU agent, add vision disabling for XAI models, test all models work in eval script 2025-04-17 19:51:50 -07:00
mathisarends-viadee 790030f59c Remove usage of available actions in planner system prompt 2025-04-17 15:23:14 +02:00
Dev-Khant 52ac120e94 Merge branch 'main' into fix-huggingface-issue 2025-04-17 13:38:18 +05:30
Dev-Khant c4ea195ae4 address comments 2025-04-17 13:35:26 +05:30
Nick Sweeting df07566f3e auto-disable use_vision for deepseek models 2025-04-16 18:34:02 -07:00
Nick Sweeting dc59dedbb5 cleanup console colors on exit and silence some unneeded debug logs 2025-04-16 18:11:46 -07:00
Nick Sweeting 96be634f4c fix context_lines split None error 2025-04-16 18:10:35 -07:00
Nick Sweeting 6f061e6787 log more info about the models at startup 2025-04-16 18:09:51 -07:00
Nick Sweeting 77314dc6f0 simplify model name getter 2025-04-16 17:12:39 -07:00
Nick Sweeting 0f5421a7b1 Merge pull request #1229 from Alezander9/tool-use-example 2025-04-16 16:02:22 -07:00
Nick Sweeting b9d27856df Merge pull request #973 from pppp606/feature/add_logger_use_tokens 2025-04-16 15:56:30 -07:00
Nick Sweeting 3fa7b21305 Update browser_use/agent/service.py 2025-04-16 18:56:14 -04:00
Nick Sweeting 8ba3e570e6 Merge branch 'main' into bot-detection-batch 2025-04-16 15:19:02 -07:00
Nick Sweeting 4ef475dda3 Merge pull request #1368 from asasasasasbc/use_arial_unicode 2025-04-16 15:04:53 -07:00
Dha-aa 7ca46f22c2 Run ruff fix and format on modified files 2025-04-16 11:46:58 +05:30
Dha-aa 27525a8595 Add GROK_API_KEY to REQUIRED_LLM_API_ENV_VARS in agent/views.py 2025-04-16 10:52:28 +05:30
Dev-Khant 99604656e4 Mem0: Embedder config for different LLMs 2025-04-16 09:03:26 +05:30
Alezander9 a03aa443de Fix AgentHookFunc type to be awaitable to correctly reflect usage of await on_step_start(self) and await on_step_end(self) in the agent service 2025-04-14 15:25:24 -07:00
Alan Zhang / 遗忘的银灵 d8a020060f Add ArialUni font rendering, which can fix non-alphabet character rendering issues in gif picture 2025-04-14 18:10:19 +08:00
Gregor Žunič 28aa38c7d5 set enable_memory to False 2025-04-14 11:47:23 +02:00
Gregor Žunič facab7c9d1 Merge branch 'main' into gregor/lib-53-fix-extraction-layer-problems 2025-04-14 11:15:01 +02:00
mathisarends-viadee 99ea9882be Explain new extended planner system prompt feature in docs 2025-04-14 09:27:32 +02:00
mathisarends-viadee 075d776bb3 Add extend function for planning system prompt 2025-04-14 09:27:31 +02:00
neo773 c33c3aeb35 Merge branch 'main' into bot-detection-batch 2025-04-12 07:25:58 +05:30
koreng-nimble 18c7e034e8 Fix prompt variable syntax: replace {{max_actions}} with {max_actions} (#1342)
The double braces prevented the value from being interpolated properly. Updated to single braces so `format` correctly replaces it with the real value.
2025-04-10 15:27:45 +02:00