Skip to content

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

Small token changes

Magnus Müllera50f2ca5b35f
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py
index a03eefa59..c4c2e5b53 100644
--- a/browser_use/agent/prompts.py
+++ b/browser_use/agent/prompts.py
@@ -275,12 +275,12 @@ Available tabs:
def _get_agent_state_description(self) -> str:
if self.step_info:
- step_info_description = f'Step {self.step_info.step_number + 1}. Maximum steps: {self.step_info.max_steps}\n'
+ step_info_description = f'Step{self.step_info.step_number + 1} maximum:{self.step_info.max_steps}\n'
else:
step_info_description = ''
time_str = datetime.now().strftime('%Y-%m-%d')
- step_info_description += f'Current date: {time_str}'
+ step_info_description += f'Today:{time_str}'
_todo_contents = self.file_system.get_todo_contents() if self.file_system else ''
if not len(_todo_contents):
@@ -298,12 +298,12 @@ Available tabs:
</todo_contents>
"""
if self.sensitive_data:
- agent_state += f'<sensitive_data>\n{self.sensitive_data}\n</sensitive_data>\n'
+ agent_state += f'<sensitive_data>{self.sensitive_data}</sensitive_data>\n'
- agent_state += f'<step_info>\n{step_info_description}\n</step_info>\n'
+ agent_state += f'<step_info>{step_info_description}</step_info>\n'
if self.available_file_paths:
available_file_paths_text = '\n'.join(self.available_file_paths)
- agent_state += f'<available_file_paths>\n{available_file_paths_text}\nUse absolute full paths when referencing these files.\n</available_file_paths>\n'
+ agent_state += f'<available_file_paths>{available_file_paths_text}\nUse with absolute paths</available_file_paths>\n'
return agent_state
@observe_debug(ignore_input=True, ignore_output=True, name='get_user_message')