Skip to content

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

agent-add-step-info-to-take-step

Magnus Müller7fda8927d299
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 9d15229ae..d5120923e 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1061,13 +1061,13 @@ class Agent(Generic[Context, AgentStructuredOutput]):
)
)
- async def take_step(self) -> tuple[bool, bool]:
+ async def take_step(self, step_info: AgentStepInfo | None = None) -> tuple[bool, bool]:
"""Take a step
Returns:
Tuple[bool, bool]: (is_done, is_valid)
"""
- await self.step()
+ await self.step(step_info)
if self.state.history.is_done():
await self.log_completion()