Add scoped Agent-mode pipeline as experimental Classic fork.
Wire specialist waves, Brain consolidation, and Classic-compatible reports so Agent mode can run end-to-end via OpenRouter without changing the default Classic path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+16
-3
@@ -18,7 +18,7 @@ from fastapi.responses import HTMLResponse, JSONResponse, Response
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from backend import config
|
||||
from backend.jobs import create_job, get_job
|
||||
from backend.jobs import PIPELINE_MODES, create_job, get_job
|
||||
from backend.pipeline.pdf_processor import render_page_jpeg
|
||||
|
||||
app = FastAPI(title=config.APP_TITLE, version=config.APP_VERSION)
|
||||
@@ -42,6 +42,7 @@ async def check(
|
||||
occupancy: Optional[str] = Form(None),
|
||||
work_type: Optional[str] = Form(None),
|
||||
text_local: bool = Form(False),
|
||||
pipeline_mode: str = Form("classic"),
|
||||
):
|
||||
"""
|
||||
Accept a PDF, start a background conflict check, and return a job_id
|
||||
@@ -53,6 +54,12 @@ async def check(
|
||||
"""
|
||||
if not file.filename.lower().endswith(".pdf"):
|
||||
raise HTTPException(status_code=400, detail="Please upload a PDF.")
|
||||
pipeline_mode = pipeline_mode.strip().lower()
|
||||
if pipeline_mode not in PIPELINE_MODES:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail=f"pipeline_mode must be one of: {', '.join(sorted(PIPELINE_MODES))}",
|
||||
)
|
||||
|
||||
os.makedirs(config.UPLOAD_DIR, exist_ok=True)
|
||||
suffix = "_" + os.path.basename(file.filename)
|
||||
@@ -70,8 +77,14 @@ async def check(
|
||||
if v and v.strip()
|
||||
}
|
||||
job_id = create_job(tmp_path, source_filename=file.filename, email=email,
|
||||
project_input=project_input, text_local=text_local)
|
||||
return JSONResponse({"job_id": job_id, "status": "queued", "email": email})
|
||||
project_input=project_input, text_local=text_local,
|
||||
pipeline_mode=pipeline_mode)
|
||||
return JSONResponse({
|
||||
"job_id": job_id,
|
||||
"status": "queued",
|
||||
"email": email,
|
||||
"pipeline_mode": pipeline_mode,
|
||||
})
|
||||
|
||||
|
||||
@app.get("/jobs/{job_id}")
|
||||
|
||||
Reference in New Issue
Block a user