Skip to content

Commit abdf95c

Browse files
committed
add deep research to webui
1 parent fe16935 commit abdf95c

File tree

5 files changed

+209
-368
lines changed

5 files changed

+209
-368
lines changed

src/agent/custom_prompts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from browser_use.agent.views import ActionResult, ActionModel
66
from browser_use.browser.views import BrowserState
77
from langchain_core.messages import HumanMessage, SystemMessage
8+
from datetime import datetime
89

910
from .custom_views import CustomAgentStepInfo
1011

@@ -116,15 +117,11 @@ def get_system_message(self) -> SystemMessage:
116117
Returns:
117118
str: Formatted system prompt
118119
"""
119-
time_str = self.current_date.strftime("%Y-%m-%d %H:%M")
120-
121120
AGENT_PROMPT = f"""You are a precise browser automation agent that interacts with websites through structured commands. Your role is to:
122121
1. Analyze the provided webpage elements and structure
123122
2. Plan a sequence of actions to accomplish the given task
124123
3. Your final result MUST be a valid JSON as the **RESPONSE FORMAT** described, containing your action sequence and state assessment, No need extra content to expalin.
125124
126-
Current date and time: {time_str}
127-
128125
{self.input_format()}
129126
130127
{self.important_rules()}
@@ -159,6 +156,9 @@ def get_user_message(self) -> HumanMessage:
159156
step_info_description = f'Current step: {self.step_info.step_number}/{self.step_info.max_steps}\n'
160157
else:
161158
step_info_description = ''
159+
160+
time_str = datetime.now().strftime("%Y-%m-%d %H:%M")
161+
step_info_description += "Current date and time: {time_str}"
162162

163163
elements_text = self.state.element_tree.clickable_elements_to_string(include_attributes=self.include_attributes)
164164

0 commit comments

Comments
 (0)