Merge pull request 'add optimization to browser-use' (#18) from feature/browser-use-optimization into main
All checks were successful
Deploy to BrowserUse VPS / deploy (push) Successful in 3s
All checks were successful
Deploy to BrowserUse VPS / deploy (push) Successful in 3s
Reviewed-on: #18
This commit is contained in:
commit
8f86dbbdac
1 changed files with 14 additions and 1 deletions
|
|
@ -9,6 +9,13 @@ from urllib import error, request
|
|||
from browser_use import Agent, Browser, ChatOpenAI
|
||||
from pydantic import BaseModel, Field, ValidationError, field_validator
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
|
||||
class RunTaskRequest(BaseModel):
|
||||
"""RPC payload для запуска browser-use задачи."""
|
||||
|
|
@ -75,7 +82,13 @@ async def run_browser_task(task: str) -> RunTaskSuccessResponse | RunTaskErrorRe
|
|||
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