from fastapi import APIRouter
from primera_ejecucion_de_un_agente import  flujo_principal as run_task

router = APIRouter()

@router.post("/run")
def execute_task(task_name: str):
    result = run_task()
    return {"task": task_name, "result": result}