mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
- Added new tools: "get 2fa code" and "send emails" to the basic tools section. - Updated action registration instructions to simplify usage of the `@controller.action` decorator. - Clarified return types for tools, allowing both `ActionResult` and simple strings. - Improved examples for success and error responses, emphasizing the use of `ActionResult` properties.
41 lines
756 B
Plaintext
41 lines
756 B
Plaintext
---
|
|
title: "Basics"
|
|
description: ""
|
|
icon: "play"
|
|
mode: "wide"
|
|
---
|
|
|
|
You can add custom tools to our [default tools](https://github.com/browser-use/browser-use/blob/main/browser_use/controller/service.py).
|
|
|
|
Examples:
|
|
- deterministic clicks
|
|
- file handling
|
|
- calling APIs
|
|
- human-in-the-loop
|
|
- browser interactions
|
|
- calling other LLMs
|
|
- get 2fa code
|
|
- send emails
|
|
...
|
|
|
|
|
|
## Quick Example
|
|
|
|
|
|
```python
|
|
from browser_use import Controller, ActionResult
|
|
|
|
controller = Controller()
|
|
|
|
@controller.action('Ask human for help with a question')
|
|
def ask_human(question: str) -> ActionResult:
|
|
answer = input(f'{question} > ')
|
|
return f'The human responded with: {answer}'
|
|
|
|
agent = Agent(
|
|
task='Ask human for help',
|
|
llm=llm,
|
|
controller=controller,
|
|
)
|
|
```
|