Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
32 lines
632 B
Plaintext
32 lines
632 B
Plaintext
---
|
|
title: "Basics"
|
|
description: "Tools are the functions that the agent has to interact with the world."
|
|
icon: "play"
|
|
mode: "wide"
|
|
---
|
|
|
|
|
|
## Quick Example
|
|
|
|
|
|
```python
|
|
from browser_use import Tools, ActionResult, Browser
|
|
|
|
tools = Tools()
|
|
|
|
@tools.action('Ask human for help with a question')
|
|
def ask_human(question: str, browser: Browser) -> ActionResult:
|
|
answer = input(f'{question} > ')
|
|
return f'The human responded with: {answer}'
|
|
|
|
agent = Agent(
|
|
task='Ask human for help',
|
|
llm=llm,
|
|
tools=tools,
|
|
)
|
|
```
|
|
|
|
<Note>
|
|
Use `browser` parameter in tools for deterministic [Actor](/customize/actor/basics) actions.
|
|
</Note>
|