Keramo commited on
Commit
2ed85b3
·
verified ·
1 Parent(s): 2789d3d

Upload 4 files

Browse files
models/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ """
2
+ Models package.
3
+ """
models/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (197 Bytes). View file
 
models/__pycache__/schemas.cpython-314.pyc ADDED
Binary file (2.64 kB). View file
 
models/schemas.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ models/schemas.py
3
+ Pydantic response schemas for FastAPI automatic OpenAPI documentation.
4
+ """
5
+
6
+ from datetime import datetime, timezone
7
+
8
+ from pydantic import BaseModel, Field
9
+
10
+ from config.constants import API_VERSION
11
+
12
+
13
+ class HealthResponse(BaseModel):
14
+ status: str = Field(..., json_schema_extra={"example": "healthy"})
15
+ engine: str = Field(..., json_schema_extra={"example": "rembg-silueta"})
16
+ model_loaded: bool = Field(..., json_schema_extra={"example": True})
17
+ timestamp: str = Field(
18
+ default_factory=lambda: datetime.now(timezone.utc).isoformat(),
19
+ json_schema_extra={"example": "2025-01-01T00:00:00+00:00"}
20
+ )
21
+
22
+
23
+ class RootResponse(BaseModel):
24
+ name: str = "Background Remover API"
25
+ version: str = API_VERSION
26
+ status: str = "running"
27
+
28
+
29
+ class ErrorResponse(BaseModel):
30
+ detail: str = Field(..., json_schema_extra={"example": "Unsupported image format."})