Bug Fixes. Workflow Engine #81
|
|
@ -86,11 +86,19 @@ async def execute_workflow_endpoint(
|
||||||
"type": "workflow"
|
"type": "workflow"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Wrapper function to match workflow_executor's expected signature: (prompt, model) -> str
|
||||||
|
# workflow_executor calls: openrouter_call_func(prompt, "anthropic/claude-sonnet-4")
|
||||||
|
# but call_openrouter expects: call_openrouter(prompt, max_tokens=4096)
|
||||||
|
async def workflow_llm_call(prompt: str, model: str) -> str:
|
||||||
|
# Ignore model parameter (already set in OPENROUTER_MODEL env var)
|
||||||
|
# Use default max_tokens=4096 from call_openrouter
|
||||||
|
return await call_openrouter(prompt)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = await execute_workflow_prompt(
|
result = await execute_workflow_prompt(
|
||||||
prompt=workflow_prompt,
|
prompt=workflow_prompt,
|
||||||
variables=variables,
|
variables=variables,
|
||||||
openrouter_call_func=call_openrouter,
|
openrouter_call_func=workflow_llm_call, # Use wrapper with correct signature
|
||||||
enable_debug=request.enable_debug
|
enable_debug=request.enable_debug
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user