add optimization to browser-use
This commit is contained in:
parent
50589232d6
commit
5aeb26b222
1 changed files with 14 additions and 1 deletions
|
|
@ -6,6 +6,13 @@ from urllib import error, request
|
|||
|
||||
from browser_use import Agent, Browser, ChatOpenAI
|
||||
|
||||
SPEED_OPTIMIZATION_PROMPT = """
|
||||
Speed optimization instructions:
|
||||
- Be extremely concise and direct in your responses
|
||||
- Get to the goal as quickly as possible
|
||||
- Use multi-action sequences whenever possible to reduce steps
|
||||
"""
|
||||
|
||||
|
||||
def _json_response(handler, status_code, payload):
|
||||
data = json.dumps(payload, ensure_ascii=False).encode("utf-8")
|
||||
|
|
@ -29,7 +36,13 @@ async def run_browser_task(task):
|
|||
temperature=0.0,
|
||||
)
|
||||
|
||||
agent = Agent(task=task, llm=llm, browser=browser)
|
||||
agent = Agent(task=task,
|
||||
llm=llm,
|
||||
browser=browser,
|
||||
flash_mode=True,
|
||||
use_vision=False,
|
||||
extend_system_message=SPEED_OPTIMIZATION_PROMPT,
|
||||
)
|
||||
|
||||
try:
|
||||
history = await agent.run()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue