Skip to content

Commit 9124073

Browse files
aaaaLuoluomenglingJINO-ROHITWendong-Fan
authored
fix: web_agent prompt word accumulation model accuracy decreases (camel-ai#2158)
Co-authored-by: luomengling <[email protected]> Co-authored-by: JINO ROHIT <[email protected]> Co-authored-by: Wendong-Fan <[email protected]>
1 parent f2b14c2 commit 9124073

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

camel/toolkits/browser_toolkit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,8 @@ def _observe(
11751175
message = BaseMessage.make_user_message(
11761176
role_name='user', content=observe_prompt, image_list=[img]
11771177
)
1178+
r""" Reset the history message of web_agent. Important history information is already included in the history field in observe_prompt."""
1179+
self.web_agent.reset()
11781180
resp = self.web_agent.step(message)
11791181

11801182
resp_content = resp.msgs[0].content
@@ -1404,6 +1406,8 @@ def _task_replanning(
14041406
- `if_need_replan`: bool, A boolean value indicating whether the task needs to be fundamentally replanned.
14051407
- `replanned_schema`: str, The replanned schema for the task, which should not be changed too much compared with the original one. If the task does not need to be replanned, the value should be an empty string.
14061408
"""
1409+
r""" Reset the history message of planning_agent. Important history information is already included in the history field in replanning_prompt."""
1410+
self.planning_agent.reset()
14071411
resp = self.planning_agent.step(replanning_prompt)
14081412
resp_dict = _parse_json_output(resp.msgs[0].content)
14091413

0 commit comments

Comments
 (0)