Commit Graph

115 Commits

Author SHA1 Message Date
Magnus Müller
e1e8003c24 Fix: Ensure direct action calls go through act() for consistent error handling
The action_wrapper now delegates to act() instead of calling registry.execute_action() directly.
This ensures:
- Consistent error handling (returns ActionResult with error, not raw exceptions)
- Consistent result normalization (always returns ActionResult)
- Full observability (Laminar spans, logging)
- Proper handling of BrowserError and TimeoutError

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 19:34:18 -07:00
Magnus Müller
56a301ed7d Linter 2025-10-24 19:26:14 -07:00
Magnus Müller
c9137fe029 Add direct action call API to Tools via __getattr__
Enable simpler, more ergonomic action calls in tests and direct usage:
- Old API: tools.act(NavigateActionModel(navigate=GoToUrlAction(...)), browser_session)
- New API: tools.navigate(url=..., browser_session=browser_session)

Implementation:
- Added __getattr__ method to Tools class that dynamically creates action wrappers
- Delegates to existing registry.execute_action() to avoid code duplication
- Works with all Tools subclasses (Tools, CodeAgentTools, custom subclasses)
- Works with custom registered actions
- Maintains full backward compatibility with existing act() API

Benefits:
- Significantly reduces boilerplate in tests
- More intuitive and Pythonic API
- All existing code continues to work unchanged
- No code duplication (delegates to registry)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 19:25:00 -07:00
Magnus Müller
1f58f60c2e Fix evaluate 2025-10-21 21:50:41 -07:00
Magnus Müller
4d5261418e 2 upload function 2025-10-21 21:44:27 -07:00
Magnus Müller
9caa248316 Merge code7 branch changes 2025-10-21 18:55:54 -07:00
Magnus Müller
c13c44be5f Fix js include matches 2025-10-14 16:40:43 -07:00
Magnus Müller
8736825e39 No comments 2025-10-14 16:05:56 -07:00
Magnus Müller
4440c187af evaluate js 2025-10-14 16:03:13 -07:00
Magnus Müller
b5afe2fece Linter 2025-10-14 15:41:13 -07:00
Magnus Müller
c9b99797fb Better parsing 2025-10-14 15:35:41 -07:00
Magnus Müller
2f43b5cfbe Parse js 2025-10-14 15:25:48 -07:00
Magnus Müller
20f8ef81e1 Unify extract in actor and tools 2025-10-13 21:11:26 -07:00
Magnus Müller
84395f1641 Filter out json and metadata from markdown 2025-10-13 20:31:21 -07:00
Magnus Müller
cf09b81af3 Update to markdownify 2025-10-13 20:07:38 -07:00
Magnus Müller
6316ae693b First version 2025-10-13 18:58:21 -07:00
Magnus Müller
74f0c25b8e Fix memory 2025-10-12 16:20:10 -07:00
Magnus Müller
4078b6e265 Remove while_holding_ctrl logic in click 2025-10-12 16:11:09 -07:00
Magnus Müller
e69ba30db6 Fix double space 2025-10-12 13:20:27 -07:00
Magnus Müller
301fab0726 Reduce tokens for extract 2025-10-12 13:08:44 -07:00
Magnus Müller
1ac613ca0e Scroll return reduction 2025-10-12 13:08:22 -07:00
Magnus Müller
40a591e4d2 Default function to get coords by backendnode id 2025-10-11 15:48:32 -07:00
Magnus Müller
a4e8eebdd1 Wait log 2025-10-11 12:53:43 -07:00
Magnus Müller
f09004ebd5 include todo in files 2025-10-11 10:52:44 -07:00
Magnus Müller
1086a5634c Init 2025-10-09 11:44:07 -07:00
Magnus Müller
78b53a34b7 update tools 2025-10-08 22:16:41 -07:00
Magnus Müller
de0488031d Squashed commit of the following:
commit 92d1732a40
Merge: fa4ff47a efcd2b33
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 08:18:35 2025 -0700

    Merge main

commit fa4ff47ae4
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 08:03:04 2025 -0700

    Laminar info mode

commit 8625aa9ba9
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 08:02:54 2025 -0700

    Default to flash for browser use llm

commit 69a517ad7c
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 08:02:44 2025 -0700

    Update example

commit c91467c51d
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 08:02:15 2025 -0700

    Update example

commit 4e2b3f1306
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 07:54:05 2025 -0700

    Linter

commit e8d6936a47
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 07:53:43 2025 -0700

    Example

commit 961d6fc451
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 07:52:23 2025 -0700

    Update default links

commit 0b2853859b
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Wed Oct 8 07:44:59 2025 -0700

    Default fast fasle

commit 9d67594b63
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 22:01:24 2025 -0700

    Simplify

commit f5712bdec0
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 21:45:00 2025 -0700

    Parsing json

commit 503af624dd
Merge: ef7fa1e4 0d2522b1
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 21:04:31 2025 -0700

    Merge branch 'flat-output' of https://github.com/browser-use/browser-use into flat-output

commit ef7fa1e401
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 21:04:28 2025 -0700

    Add prompt description handling for browser-use cloud service

    - Enhanced the Agent class to generate and pass prompt descriptions to the LLM when using the browser-use provider.
    - Updated the ChatBrowserUse class to accept an optional prompt_description parameter in the ainvoke method.
    - Modified the tracked_ainvoke function in TokenCost to forward additional keyword arguments.
    - Adjusted example model to initialize Laminar for tracing.

commit 0d2522b1f9
Author: Gregor Žunič <36313686+gregpr07@users.noreply.github.com>
Date:   Tue Oct 7 20:23:39 2025 -0700

    updated default base url

commit 0a2e6d6520
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 18:50:56 2025 -0700

    Hide api key

commit 96bba9692b
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 18:49:05 2025 -0700

    Add env var loading and validation to ChatBrowserUse, update example

commit c2e57a3bab
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 18:36:31 2025 -0700

    Linter

commit 3d4cc1dbec
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 16:28:10 2025 -0700

    Rename

commit 14ab0b75fe
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 16:21:52 2025 -0700

    Rename super_fast to fast parameter in ChatBrowserUse

commit 7fab3c47d3
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 16:08:10 2025 -0700

    Update system prompt

commit 2066e77b98
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 16:07:51 2025 -0700

    Del claude file

commit 297b767e91
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 16:01:50 2025 -0700

    Revert flash system prompt to JSON format

    - Reverted system_prompt_flash.md to main (JSON format)
    - Added examples/models/browser_use_cloud.py for llm-use cloud service
    - llm-use service will inject unstructured format on the server side

commit 99af55f8e9
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 15:58:40 2025 -0700

    Example

commit 657ff0d352
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 15:54:23 2025 -0700

    Remove unused

commit a42123d8e5
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 15:49:54 2025 -0700

    ignore

commit de4fe19020
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 15:48:01 2025 -0700

    Example

commit 27e5ab9947
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 14:29:01 2025 -0700

    Add llm-use cloud client example

    - ChatLLMUseCloud: Browser-use compatible client for llm-use service
    - Implements BaseChatModel protocol with proper typing
    - Includes credit checking before/after tasks
    - Error handling for 401/402/500 responses
    - Converts messages between browser-use and HTTP API formats
    - Returns ChatInvokeCompletion with usage stats

    Usage:
      export LLM_USE_URL='https://your-app.railway.app'
      export LLM_USE_API_KEY='your-key'
      python examples/llm_use_cloud_client.py

commit a47a448005
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Tue Oct 7 13:03:59 2025 -0700

    Enhance response parsing in ChatBrowserUse to handle structured data from the API, including debug logging for received data keys.

commit e79c7dc633
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Mon Oct 6 19:39:29 2025 -0700

    Include browser-use llm

commit 584d977154
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Mon Oct 6 17:55:31 2025 -0700

    Linter

commit b0ac87076a
Merge: 1183b8fe 0076775f
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Mon Oct 6 15:01:37 2025 -0700

    merge main

commit 1183b8fe6b
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 16:26:34 2025 -0700

    Fix done output action model

commit 852449b1bc
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 16:23:31 2025 -0700

    More debug info

commit a57ba25d36
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 16:07:15 2025 -0700

    Multiline parser

commit 2153dbe6aa
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 15:50:14 2025 -0700

    Fix custom output

commit ec5c08ba0f
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 15:36:54 2025 -0700

    Fix files in output

commit 7444048e8f
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 15:28:09 2025 -0700

    Update codebase with unstructured output

commit a8f05b4611
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 14:55:20 2025 -0700

    Save systemprompt

commit d7d112c569
Author: Magnus Müller <67061560+MagMueller@users.noreply.github.com>
Date:   Sun Oct 5 14:51:24 2025 -0700

    new parser
2025-10-08 08:39:24 -07:00
Magnus Müller
0fb1c73abc Remove ge=1 2025-10-05 21:47:57 -07:00
Magnus Müller
6944d4a533 Null checks 2025-10-05 20:36:23 -07:00
Magnus Müller
3eed1345c5 Increase descriptions 2025-10-05 19:41:29 -07:00
Magnus Müller
6d941a5dcc Rename Clear existing to clear 2025-10-05 19:32:39 -07:00
Magnus Müller
b53a7c116a Update outdated function names 2025-10-05 19:12:52 -07:00
Magnus Müller
586dcc0a82 Input index can be 0 2025-10-05 19:00:33 -07:00
Magnus Müller
84b07cce8c Update parameter dict 2025-10-05 15:24:37 -07:00
Magnus Müller
90d414042a Update docs 2025-10-05 15:09:35 -07:00
Magnus Müller
47bf973285 Default value for extract_links 2025-10-05 13:46:31 -07:00
Magnus Müller
f0acb6b338 Replace tool names like go_to_url wtih navigate 2025-10-05 13:31:38 -07:00
Magnus Müller
50f97000e4 file parameter naming 2025-10-05 13:21:14 -07:00
Magnus Müller
ae3b2a5926 Remove descripitons 2025-10-05 13:06:19 -07:00
Magnus Müller
1248c07e83 Remove descripitons 2025-10-05 13:02:43 -07:00
Magnus Müller
ad9b174762 Fix param 2025-10-05 12:18:21 -07:00
Magnus Müller
18b7dd95a4 Fix param 2025-10-05 12:16:13 -07:00
Magnus Müller
55d10605fd Shorter tools 2025-10-05 11:59:12 -07:00
Magnus Müller
7b995b7fc1 Refactor action field descriptions in AgentOutput models
- Removed redundant description from action field in AgentOutput and its subclasses.
- Updated action extraction documentation in Tools to clarify usage and limitations.
- Enhanced search_engine field description in SearchAction for better clarity on default behavior.
2025-10-05 11:29:19 -07:00
Magnus Müller
22acf58424 Shorter tools 2025-10-05 11:22:54 -07:00
Magnus Müller
9a655e56c5 Shorter tool description 2025-10-05 11:09:15 -07:00
Magnus Müller
461bce7b22 Request screenshot 2025-10-03 23:55:15 -07:00
mertunsall
025eb60e5f try to make actions shorter 2025-10-03 19:00:41 +02:00
Magnus Müller
dc34a5edb0 Update search google 2025-09-22 18:43:14 -07:00
Magnus Müller
022a3e352f More robust switch and close tab 2025-09-22 18:04:29 -07:00