File size: 960 Bytes
be60023 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# app/routes/pipeline.py
from fastapi import APIRouter, Depends, Query
from datetime import datetime
from agent_manager import AgentManager
from memory.database import init_db, log_action
from app.dependencies import require_api_key
router = APIRouter(
prefix="/pipeline",
tags=["Pipeline"],
dependencies=[Depends(require_api_key)]
)
@router.on_event("startup")
def startup_db():
init_db()
@router.get("/run", summary="Run full multi‑agent pipeline")
def run_pipeline(
niche: str = Query("fitness"),
business_type: str = Query("dropshipping")
):
manager = AgentManager(niche, business_type)
summary = manager.run_all()
for agent_name, result in summary.items():
log_action(agent_name, "pipeline_run", result)
return {
"status": "pipeline_executed",
"niche": niche,
"business_type": business_type,
"results": summary,
"timestamp": datetime.utcnow().isoformat()
}
|