diff --git a/backend/routers/prompts.py b/backend/routers/prompts.py index 6c7f8a5..e50e47a 100644 --- a/backend/routers/prompts.py +++ b/backend/routers/prompts.py @@ -254,6 +254,11 @@ def import_prompts( } +# ══════════════════════════════════════════════════════════════════════════════ +# UNIFIED PROMPT SYSTEM (Issue #28 Phase 2) +# ══════════════════════════════════════════════════════════════════════════════ + +from prompt_executor import execute_prompt_with_data from models import UnifiedPromptCreate, UnifiedPromptUpdate @@ -403,9 +408,8 @@ async def execute_unified_prompt_stream( "Connection": "keep-alive", "X-Accel-Buffering": "no" # Disable nginx buffering } + ) -# NOTE: /execute-stream MUST be defined BEFORE /{prompt_id} to avoid route conflicts -# FastAPI matches routes in order, so specific routes must come before catch-all patterns @router.get("/{prompt_id}") def get_prompt(prompt_id: str, session: dict=Depends(require_auth)): @@ -1590,15 +1594,7 @@ def reset_prompt_to_default(prompt_id: str, session: dict=Depends(require_admin) return {"ok": True} -# ══════════════════════════════════════════════════════════════════════════════ -# UNIFIED PROMPT SYSTEM (Issue #28 Phase 2) -# ══════════════════════════════════════════════════════════════════════════════ - -from prompt_executor import execute_prompt_with_data - ) - - - +@router.post("/execute") async def execute_unified_prompt( prompt_slug: str = Query(..., description="Slug of prompt to execute"), modules: Optional[dict] = None,