Spaces:
Sleeping
Sleeping
from typing import Any, Dict, Optional | |
from pydantic import BaseModel | |
class SubmitResponse(BaseModel): | |
task_id: str | |
class ResultResponse(BaseModel): | |
request_meta: Optional[Dict[str, str]] = None | |
task_id: str | |
result: dict | |
status_code: int | |
detail: str | |
attempt: int | |
class HealthCheckResponse(BaseModel): | |
status: str | |
class APIResponse(BaseModel): | |
detail: str | |
data: Dict[str, Any] | |
attempts: int | |
class APIErrorResponse(BaseModel): | |
detail: str | |
HEALTH_CHECK_RESPONSES = {} | |
SUBMIT_EXTRACT_RESPONSES = { | |
400: { | |
"model": APIErrorResponse, | |
}, | |
500: {"model": APIErrorResponse}, | |
} | |
SUBMIT_FOLLOW_RESPONSES = { | |
400: { | |
"model": APIErrorResponse, | |
}, | |
500: {"model": APIErrorResponse}, | |
} | |
RESULT_RESPONSES = { | |
400: { | |
"model": APIErrorResponse, | |
}, | |
404: { | |
"model": APIErrorResponse, | |
}, | |
500: {"model": APIErrorResponse}, | |
} | |
RESPONSES = { | |
400: { | |
"model": APIErrorResponse, | |
}, | |
404: { | |
"model": APIErrorResponse, | |
}, | |
500: {"model": APIErrorResponse}, | |
} | |