55 lines
943 B
Python
Raw Normal View History

2024-10-13 16:38:23 +04:00
from pydantic import BaseModel
from typing import Optional
2024-10-13 16:38:23 +04:00
class LaptopCreate(BaseModel):
brand: str
2024-10-13 16:38:23 +04:00
processor: str
ram: int
os: str
ssd: int
display: float
gpu: str
weight: float
battery_size: int
release_year: int
display_type: str
2024-10-13 16:38:23 +04:00
2024-12-02 21:27:11 +04:00
class TVCreate(BaseModel):
display: str
tuners: str
features: str
os: str
power_of_volume: str
screen_sizes: int
color: str
2024-10-13 16:38:23 +04:00
class LaptopResponse(BaseModel):
id: int
brand: str
2024-10-13 16:38:23 +04:00
processor: str
ram: int
os: str
ssd: int
display: float
gpu: str
weight: float
battery_size: int
release_year: int
display_type: str
2024-10-13 16:38:23 +04:00
class Config:
orm_mode = True
2024-12-02 21:27:11 +04:00
class TVResponse(BaseModel):
id: int
display: str
tuners: str
features: str
os: str
power_of_volume: str
screen_sizes: int
color: str
2024-10-13 16:38:23 +04:00
class PredictPriceResponse(BaseModel):
predicted_price: float