feat(pipeline): add submit-pass0b endpoint for batch submission
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2291,3 +2291,31 @@ async def get_batch_process_status(job_id: str):
|
||||
if not status:
|
||||
raise HTTPException(status_code=404, detail="Batch processing job not found")
|
||||
return status
|
||||
|
||||
|
||||
class SubmitPass0bRequest(BaseModel):
|
||||
limit: int = 10
|
||||
batch_size: int = 5
|
||||
|
||||
|
||||
@router.post("/generate/submit-pass0b")
|
||||
async def submit_pass0b(req: SubmitPass0bRequest):
|
||||
"""Submit Pass 0b batch to Anthropic Batch API.
|
||||
|
||||
Loads unprocessed obligations, applies pre-LLM filter, submits batch.
|
||||
Returns batch_id for status polling and later result processing.
|
||||
"""
|
||||
from services.decomposition_pass import DecompositionPass
|
||||
db = SessionLocal()
|
||||
try:
|
||||
dp = DecompositionPass(db)
|
||||
result = await dp.submit_batch_pass0b(
|
||||
limit=req.limit,
|
||||
batch_size=req.batch_size,
|
||||
)
|
||||
return result
|
||||
except Exception as e:
|
||||
logger.error("Submit Pass 0b failed: %s", e)
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
Reference in New Issue
Block a user