user defined browser header (#2752)

Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
This commit is contained in:
Shuchang Zheng
2025-06-19 00:42:34 -07:00
committed by GitHub
parent 2776475ca3
commit df5f40bdb9
15 changed files with 132 additions and 10 deletions

View File

@@ -167,6 +167,7 @@ async def initialize_task_v2(
model: dict[str, Any] | None = None,
max_screenshot_scrolling_times: int | None = None,
browser_session_id: str | None = None,
extra_http_headers: dict[str, str] | None = None,
) -> TaskV2:
task_v2 = await app.DATABASE.create_task_v2(
prompt=user_prompt,
@@ -179,6 +180,7 @@ async def initialize_task_v2(
error_code_mapping=error_code_mapping,
model=model,
max_screenshot_scrolling_times=max_screenshot_scrolling_times,
extra_http_headers=extra_http_headers,
)
# set task_v2_id in context
context = skyvern_context.current()
@@ -222,12 +224,15 @@ async def initialize_task_v2(
metadata.workflow_title,
proxy_location=proxy_location,
status=workflow_status,
max_screenshot_scrolling_times=max_screenshot_scrolling_times,
extra_http_headers=extra_http_headers,
)
workflow_run = await app.WORKFLOW_SERVICE.setup_workflow_run(
request_id=None,
workflow_request=WorkflowRequestBody(
max_screenshot_scrolling_times=max_screenshot_scrolling_times,
browser_session_id=browser_session_id,
extra_http_headers=extra_http_headers,
),
workflow_permanent_id=new_workflow.workflow_permanent_id,
organization=organization,