Skip to content

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

test laminar from branch and small fix

mertunsallc91b20367ca7
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index a77fdcc9f..3d8179f2b 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -104,7 +104,7 @@ class AgentMessagePrompt:
self.screenshots = screenshots or []
assert self.browser_state
- @observe_debug(name='_deduplicate_screenshots')
+ @observe_debug(name='_deduplicate_screenshots', ignore_output=True)
def _deduplicate_screenshots(self, screenshots: list[str]) -> list[str]:
"""
Remove consecutive duplicate screenshots, keeping only the most recent of each.
@@ -295,53 +295,3 @@ Interactive elements from top layer of the current page inside the viewport{trun
return UserMessage(content=content_parts)
return UserMessage(content=state_description)
-
-
-class PlannerPrompt:
- def __init__(self, available_actions: str):
- self.available_actions = available_actions
-
- def get_system_message(
- self, is_planner_reasoning: bool, extended_planner_system_prompt: str | None = None
- ) -> SystemMessage | UserMessage:
- """Get the system message for the planner.
-
- Args:
- is_planner_reasoning: If True, return as HumanMessage for chain-of-thought
- extended_planner_system_prompt: Optional text to append to the base prompt
-
- Returns:
- SystemMessage or HumanMessage depending on is_planner_reasoning
- """
-
- planner_prompt_text = """
-You are a planning agent that helps break down tasks into smaller steps and reason about the current state.
-Your role is to:
-1. Analyze the current state and history
-2. Evaluate progress towards the ultimate goal
-3. Identify potential challenges or roadblocks
-4. Suggest the next high-level steps to take
-
-Inside your messages, there will be AI messages from different agents with different formats.
-
-Your output format should be always a JSON object with the following fields:
-{{
- "state_analysis": "Brief analysis of the current state and what has been done so far",
- "progress_evaluation": "Evaluation of progress towards the ultimate goal (as percentage and description)",
- "challenges": "List any potential challenges or roadblocks",
- "next_steps": "List 2-3 concrete next steps to take",
- "reasoning": "Explain your reasoning for the suggested next steps"
-}}
-
-Ignore the other AI messages output structures.
-
-Keep your responses concise and focused on actionable insights.
-"""
-
- if extended_planner_system_prompt:
- planner_prompt_text += f'\n{extended_planner_system_prompt}'
-
- if is_planner_reasoning:
- return UserMessage(content=planner_prompt_text)
- else:
- return SystemMessage(content=planner_prompt_text)
diff --git a/pyproject.toml b/pyproject.toml
index fee168db4..b41cb50af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,6 +42,7 @@ dependencies = [
"mcp>=1.10.1",
"pypdf>=5.7.0",
"markdown-pdf>=1.7",
+ "lmnr[all]",
]
# google-api-core: only used for Google LLM APIs
# pyperclip: only used for examples that use copy/paste
@@ -199,3 +200,11 @@ dev-dependencies = [
# "pytest-playwright-asyncio>=0.7.0", # not actually needed I think
"pytest-timeout>=2.4.0",
]
+
+[tool.uv.sources]
+lmnr = { git = "https://github.com/lmnr-ai/lmnr-python.git", rev = "isolated-context" }
+
+[tool.uv.workspace]
+members = [
+ "groq-demo",
+]