Upgrade context limit (#235)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
|
||||
import structlog
|
||||
from playwright.async_api import Browser, Playwright, async_playwright
|
||||
|
||||
@@ -52,9 +54,8 @@ class BrowserManager:
|
||||
self.pages[task.task_id] = self.pages[task.workflow_run_id]
|
||||
return self.pages[task.task_id]
|
||||
|
||||
# TODO: percentage to use new context tree, starting from 20%
|
||||
# new_ctx = random.choices([False, True], weights=[0.8, 0.2], k=1)[0]
|
||||
new_ctx = False
|
||||
# TODO: percentage (50%) to use new context tree
|
||||
new_ctx = random.choices([False, True], weights=[0.5, 0.5], k=1)[0]
|
||||
LOG.info("Creating browser state for task", task_id=task.task_id, new_ctx=new_ctx)
|
||||
browser_state = await self._create_browser_state(task.proxy_location, task.url, new_ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user