REFACTOR API gateway fix 9
This commit is contained in:
@@ -45,7 +45,7 @@ def get_training_service() -> TrainingService:
|
||||
"""Factory function for TrainingService dependency"""
|
||||
return TrainingService()
|
||||
|
||||
@router.post("/tenants/{tenant_id}/jobs", response_model=TrainingJobResponse)
|
||||
@router.post("/tenants/{tenant_id}/training/jobs", response_model=TrainingJobResponse)
|
||||
async def start_training_job(
|
||||
request: TrainingJobRequest,
|
||||
background_tasks: BackgroundTasks,
|
||||
@@ -110,7 +110,7 @@ async def start_training_job(
|
||||
tenant_id=tenant_id)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to start training job: {str(e)}")
|
||||
|
||||
@router.get("/tenants/{tenant_id}/jobs", response_model=List[TrainingJobResponse])
|
||||
@router.get("/tenants/{tenant_id}/training/jobs", response_model=List[TrainingJobResponse])
|
||||
async def get_training_jobs(
|
||||
status: Optional[TrainingStatus] = Query(None, description="Filter jobs by status"),
|
||||
limit: int = Query(100, ge=1, le=1000),
|
||||
@@ -146,7 +146,7 @@ async def get_training_jobs(
|
||||
tenant_id=tenant_id)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to get training jobs: {str(e)}")
|
||||
|
||||
@router.get("/tenants/{tenant_id}/jobs/{job_id}", response_model=TrainingJobResponse)
|
||||
@router.get("/tenants/{tenant_id}/training/jobs/{job_id}", response_model=TrainingJobResponse)
|
||||
async def get_training_job(
|
||||
job_id: str,
|
||||
tenant_id: UUID = Path(..., description="Tenant ID"),
|
||||
@@ -179,7 +179,7 @@ async def get_training_job(
|
||||
job_id=job_id)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to get training job: {str(e)}")
|
||||
|
||||
@router.get("/tenants/{tenant_id}/jobs/{job_id}/progress", response_model=TrainingJobProgress)
|
||||
@router.get("/tenants/{tenant_id}/training/jobs/{job_id}/progress", response_model=TrainingJobProgress)
|
||||
async def get_training_progress(
|
||||
job_id: str,
|
||||
tenant_id: UUID = Path(..., description="Tenant ID"),
|
||||
@@ -254,7 +254,7 @@ async def cancel_training_job(
|
||||
job_id=job_id)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to cancel training job: {str(e)}")
|
||||
|
||||
@router.post("/tenants/{tenant_id}/products/{product_name}", response_model=TrainingJobResponse)
|
||||
@router.post("/tenants/{tenant_id}/training/products/{product_name}", response_model=TrainingJobResponse)
|
||||
async def train_single_product(
|
||||
product_name: str,
|
||||
request: SingleProductTrainingRequest,
|
||||
@@ -309,7 +309,7 @@ async def train_single_product(
|
||||
tenant_id=tenant_id)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to train product: {str(e)}")
|
||||
|
||||
@router.post("/tenants/{tenant_id}/validate", response_model=DataValidationResponse)
|
||||
@router.post("/tenants/{tenant_id}/training/validate", response_model=DataValidationResponse)
|
||||
async def validate_training_data(
|
||||
request: DataValidationRequest,
|
||||
tenant_id: UUID = Path(..., description="Tenant ID"),
|
||||
|
||||
Reference in New Issue
Block a user