Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Merge branch 'main' into mert/new_everything

Magnus Müllerad446f57696a
diff --cc browser_use/utils.py
index d3ae158d3,2180b7000..7e1d90055
--- a/browser_use/utils.py
+++ b/browser_use/utils.py
@@@ -14,16 -14,8 +14,18 @@@ from urllib.parse import urlpars
logger = logging.getLogger(__name__)
+# Import error types - these may need to be adjusted based on actual import paths
+try:
+ from openai import BadRequestError as OpenAIBadRequestError
+except ImportError:
+ OpenAIBadRequestError = None
+
+try:
+ from groq import BadRequestError as GroqBadRequestError
+except ImportError:
+ GroqBadRequestError = None
+ # Browser Use configuration directory
+ BROWSER_USE_CONFIG_DIR = Path.home() / '.config' / 'browseruse'
# Global flag to prevent duplicate exit messages
_exiting = False