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
Fixed bug for empty parameters
magmueller3b047656f089
diff --git a/browser_use/controller/registry/service.py b/browser_use/controller/registry/service.pyindex 72de3dd07..032ab316a 100644--- a/browser_use/controller/registry/service.py+++ b/browser_use/controller/registry/service.py@@ -76,11 +76,8 @@ class Registry:# Check if the first parameter is a Pydantic modelsig = signature(action.function)- first_param = next(iter(sig.parameters.values()))- is_pydantic = (- hasattr(first_param.annotation, '__bases__')- and BaseModel in first_param.annotation.__bases__- )+ parameters = list(sig.parameters.values())+ is_pydantic = parameters and issubclass(parameters[0].annotation, BaseModel)# Execute with or without browserif action.requires_browser:@@ -95,7 +92,7 @@ class Registry:return action.function(**validated_params.model_dump())except Exception as e:- raise Exception(f'Error executing action {action_name}: {str(e)}')+ raise RuntimeError(f'Error executing action {action_name}: {str(e)}') from edef create_action_model(self) -> Type[ActionModel]:"""Creates a Pydantic model from registered actions"""