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

@@ -629,7 +629,14 @@ class BaseTaskBlock(Block):
current_context = skyvern_context.ensure_context()
current_context.task_id = task.task_id
llm_key = workflow.determine_llm_key(block=self)
llm_caller = None if not llm_key else LLMCaller(llm_key=llm_key)
screenshot_scaling_enabled = False
if self.engine == RunEngine.anthropic_cua:
screenshot_scaling_enabled = True
llm_caller = (
None
if not llm_key
else LLMCaller(llm_key=llm_key, screenshot_scaling_enabled=screenshot_scaling_enabled)
)
await app.agent.execute_step(
organization=organization,

View File

@@ -94,14 +94,14 @@ class Workflow(BaseModel):
mapping = settings.get_model_name_to_llm_key()
if block:
model_name = (block.model or {}).get("model")
model_name = (block.model or {}).get("name")
if model_name:
llm_key = mapping.get(model_name)
if llm_key:
return llm_key
workflow_model_name = (self.model or {}).get("model")
workflow_model_name = (self.model or {}).get("name")
if workflow_model_name:
llm_key = mapping.get(workflow_model_name)