migrate generate_script -> run_with (BE) (#3550)

This commit is contained in:
Jonathan Dobson
2025-09-29 15:14:15 -04:00
committed by GitHub
parent e04f81fcda
commit 2a3cc647a5
10 changed files with 63 additions and 33 deletions

View File

@@ -1396,7 +1396,7 @@ class AgentDB:
version: int | None = None,
is_saved_task: bool = False,
status: WorkflowStatus = WorkflowStatus.published,
generate_script: bool = False,
run_with: str | None = None,
ai_fallback: bool = False,
cache_key: str | None = None,
run_sequentially: bool = False,
@@ -1418,7 +1418,7 @@ class AgentDB:
model=model,
is_saved_task=is_saved_task,
status=status,
generate_script=generate_script,
run_with=run_with,
ai_fallback=ai_fallback,
cache_key=cache_key,
run_sequentially=run_sequentially,
@@ -1625,7 +1625,7 @@ class AgentDB:
description: str | None = None,
workflow_definition: dict[str, Any] | None = None,
version: int | None = None,
generate_script: bool | None = None,
run_with: str | None = None,
cache_key: str | None = None,
) -> Workflow:
try:
@@ -1644,8 +1644,8 @@ class AgentDB:
workflow.workflow_definition = workflow_definition
if version is not None:
workflow.version = version
if generate_script is not None:
workflow.generate_script = generate_script
if run_with is not None:
workflow.run_with = run_with
if cache_key is not None:
workflow.cache_key = cache_key
await session.commit()
@@ -2795,7 +2795,7 @@ class AgentDB:
max_screenshot_scrolling_times: int | None = None,
extra_http_headers: dict[str, str] | None = None,
browser_address: str | None = None,
generate_script: bool = False,
run_with: str | None = None,
) -> TaskV2:
async with self.Session() as session:
new_task_v2 = TaskV2Model(
@@ -2815,7 +2815,7 @@ class AgentDB:
max_screenshot_scrolling_times=max_screenshot_scrolling_times,
extra_http_headers=extra_http_headers,
browser_address=browser_address,
generate_script=generate_script,
run_with=run_with,
)
session.add(new_task_v2)
await session.commit()