INNER CODE UNIT · Python

PredictionRequest

ai-infra-curriculum/ai-infra-engineer-learning · projects/project-101-basic-model-serving/src/api.py:76

class PredictionRequest(BaseModel):
    """
    Request model for prediction endpoint

    TODO: Define the structure of your prediction request

    Fields to include:
    - image_url: Optional[str] - URL to image (if using URL-based prediction)
    - top_k: int - Number of top predictions to return (default 5)
    - threshold: float - Confidence threshold (default 0.0)

    Example:
    class PredictionRequest(BaseModel):
        image_url: Optional[str] = None
        top_k: int = Field(default=5, ge=1, le=10)
        threshold: float = Field(default=0.0, ge=0.0, le=1.0)
    """
    # TODO: Implement request model fields

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…