add optimization to browser-use #18

Merged
fedorkobylkevitch merged 1 commit from feature/browser-use-optimization into main 2026-05-04 21:39:46 +00:00
Showing only changes of commit 5aeb26b222 - Show all commits

View file

@ -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()