fix llm_key_override (#2552)

This commit is contained in:
Shuchang Zheng
2025-05-31 11:11:25 -07:00
committed by GitHub
parent 07bf256779
commit 48f5f0913e
10 changed files with 45 additions and 18 deletions

View File

@@ -96,10 +96,12 @@ class BackgroundTaskExecutor(AsyncExecutor):
)
run_obj = await app.DATABASE.get_run(run_id=task_id, organization_id=organization_id)
engine = RunEngine.skyvern_v1
screenshot_scaling_enabled = False
if run_obj and run_obj.task_run_type == RunType.openai_cua:
engine = RunEngine.openai_cua
elif run_obj and run_obj.task_run_type == RunType.anthropic_cua:
engine = RunEngine.anthropic_cua
screenshot_scaling_enabled = True
context: SkyvernContext = skyvern_context.ensure_context()
context.task_id = task.task_id
@@ -107,7 +109,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
context.max_steps_override = max_steps_override
llm_key = task.llm_key
llm_caller = LLMCaller(llm_key) if llm_key else None
llm_caller = LLMCaller(llm_key, screenshot_scaling_enabled=screenshot_scaling_enabled) if llm_key else None
if background_tasks:
background_tasks.add_task(