Fix recipe run endpoint to accept JSON body

Use Pydantic model for inputs parameter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-01-11 13:22:13 +00:00
parent b47417704e
commit 4f011a66ff

View File

@@ -28,6 +28,10 @@ class RecipeUploadRequest(BaseModel):
description: Optional[str] = None
class RecipeRunRequest(BaseModel):
inputs: List[str] = []
def get_recipe_service():
"""Get recipe service instance."""
return RecipeService(get_redis_client(), get_cache_manager())
@@ -155,7 +159,7 @@ async def delete_recipe(
@router.post("/{recipe_id}/run")
async def run_recipe(
recipe_id: str,
inputs: List[str],
req: RecipeRunRequest,
ctx: UserContext = Depends(require_auth),
recipe_service: RecipeService = Depends(get_recipe_service),
):
@@ -172,7 +176,7 @@ async def run_recipe(
run_service = RunService(database, get_redis_client(), get_cache_manager())
run, error = await run_service.create_run(
recipe=recipe.get("name", recipe_id),
inputs=inputs,
inputs=req.inputs,
use_dag=True,
actor_id=ctx.actor_id,
l2_server=ctx.l2_server,