Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
tweak cursorrules
Nick Sweeting3592eddc490e
diff --git a/.cursor/rules/browser-use-rules.mdc b/.cursor/rules/browser-use-rules.mdcindex a4f466525..899cfbb7d 100644--- a/.cursor/rules/browser-use-rules.mdc+++ b/.cursor/rules/browser-use-rules.mdc@@ -39,7 +39,7 @@ uv syncDo **not** replace `gpt-4o` with `gpt-4`. The model `gpt-4o` is a distinct release and supported.* ✅ **Type-safe coding**- Use **Pydantic models** for all internal action schemas, task inputs/outputs, and controller I/O. This ensures robust validation and LLM-call integrity.+ Use **Pydantic v2 models** for all internal action schemas, task inputs/outputs, and controller I/O. This ensures robust validation and LLM-call integrity.---@@ -48,12 +48,13 @@ uv syncTo add a new action that your browser agent can execute:```python+from playwright.async_api import Pagefrom browser_use.core.controller import Controller, ActionResultcontroller = Controller()@controller.registry.action("Search the web for a specific query")-async def search_web(query: str):+async def search_web(query: str, page: Page):# Implement your logic here, e.g., query a search engine and return resultsresult = ...return ActionResult(extracted_content=result, include_in_memory=True)@@ -71,7 +72,7 @@ async def search_web(query: str):To define a task and run a browser-use agent:```python-from browser_use.core.agent import Agent+from browser_use import Agentfrom langchain.chat_models import ChatOpenAItask = "Find the CEO of OpenAI and return their name"