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
remove lmnr
Matic Zavadlala5a026b0530a
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 58ed7e250..e5a2e873c 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -15,7 +15,8 @@ from langchain_core.messages import (HumanMessage,SystemMessage,)-from lmnr.sdk.decorators import observe++# from lmnr.sdk.decorators import observefrom openai import RateLimitErrorfrom pydantic import BaseModel, ValidationError@@ -278,7 +279,7 @@ class Agent(Generic[Context]):logger.debug('Agent paused after getting state')raise InterruptedError- @observe(name='agent.step', ignore_output=True, ignore_input=True)+ # @observe(name='agent.step', ignore_output=True, ignore_input=True)@time_execution_async('--step')async def step(self, step_info: Optional[AgentStepInfo] = None) -> None:"""Execute one step of the task"""diff --git a/browser_use/controller/service.py b/browser_use/controller/service.pyindex a8435e6b6..dc5c500d3 100644--- a/browser_use/controller/service.py+++ b/browser_use/controller/service.py@@ -5,7 +5,8 @@ from typing import Dict, Generic, Optional, Type, TypeVarfrom langchain_core.language_models.chat_models import BaseChatModelfrom langchain_core.prompts import PromptTemplate-from lmnr.sdk.laminar import Laminar++# from lmnr.sdk.laminar import Laminarfrom pydantic import BaseModelfrom browser_use.agent.views import ActionModel, ActionResult@@ -460,25 +461,25 @@ class Controller(Generic[Context]):try:for action_name, params in action.model_dump(exclude_unset=True).items():if params is not None:- with Laminar.start_as_current_span(- name=action_name,- input={- 'action': action_name,- 'params': params,- },- span_type='TOOL',- ):- result = await self.registry.execute_action(- action_name,- params,- browser=browser_context,- page_extraction_llm=page_extraction_llm,- sensitive_data=sensitive_data,- available_file_paths=available_file_paths,- context=context,- )-- Laminar.set_span_output(result)+ # with Laminar.start_as_current_span(+ # name=action_name,+ # input={+ # 'action': action_name,+ # 'params': params,+ # },+ # span_type='TOOL',+ # ):+ result = await self.registry.execute_action(+ action_name,+ params,+ browser=browser_context,+ page_extraction_llm=page_extraction_llm,+ sensitive_data=sensitive_data,+ available_file_paths=available_file_paths,+ context=context,+ )++ # Laminar.set_span_output(result)if isinstance(result, str):return ActionResult(extracted_content=result)diff --git a/browser_use/dom/service.py b/browser_use/dom/service.pyindex 649aa9d90..2514a0364 100644--- a/browser_use/dom/service.py+++ b/browser_use/dom/service.py@@ -1,9 +1,10 @@import gcimport loggingfrom importlib import resources-from typing import Optional+from typing import TYPE_CHECKING, Optional-from playwright.async_api import Page+if TYPE_CHECKING:+ from playwright.async_api import Pagefrom browser_use.dom.history_tree_processor.view import Coordinatesfrom browser_use.dom.views import (@@ -20,7 +21,7 @@ logger = logging.getLogger(__name__)class DomService:- def __init__(self, page: Page):+ def __init__(self, page: 'Page'):self.page = pageself.xpath_cache = {}diff --git a/pyproject.toml b/pyproject.tomlindex 375861115..aba884cfd 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -18,7 +18,7 @@ dependencies = ["posthog>=3.7.0","playwright>=1.49.0","setuptools>=75.8.0",- "lmnr[langchain]>=0.4.59",+ # "lmnr[langchain]>=0.4.59","markdownify==0.14.1","langchain-core>=0.3.35",]