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
Include the action description inside the schema
magmueller10224f4b88e0
diff --git a/browser_use/controller/registry/service.py b/browser_use/controller/registry/service.pyindex 1e50d0276..9d7355255 100644--- a/browser_use/controller/registry/service.py+++ b/browser_use/controller/registry/service.py@@ -2,7 +2,7 @@ import asynciofrom inspect import iscoroutinefunction, signaturefrom typing import Any, Callable, Optional, Type-from pydantic import BaseModel, create_model+from pydantic import BaseModel, Field, create_modelfrom browser_use.browser.context import BrowserContextfrom browser_use.controller.registry.views import (@@ -34,7 +34,7 @@ class Registry:}# TODO: make the types here workreturn create_model(- f'{function.__name__}Params',+ f'{function.__name__}_parameters',__base__=ActionModel,**params, # type: ignore)@@ -77,9 +77,7 @@ class Registry:return decorator- async def execute_action(- self, action_name: str, params: dict, browser: Optional[BrowserContext] = None- ) -> Any:+ async def execute_action(self, action_name: str, params: dict, browser: Optional[BrowserContext] = None) -> Any:"""Execute a registered action"""if action_name not in self.registry.actions:raise ValueError(f'Action {action_name} not found')@@ -114,7 +112,10 @@ class Registry:def create_action_model(self) -> Type[ActionModel]:"""Creates a Pydantic model from registered actions"""fields = {- name: (Optional[action.param_model], None)+ name: (+ Optional[action.param_model],+ Field(default=None, description=action.description),+ )for name, action in self.registry.actions.items()}