28 lines
962 B
Python
28 lines
962 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
|
|
class FoodImageBase(BaseModel):
|
|
image_url: str = Field(..., description="URL of the food image")
|
|
prompt: str = Field(..., description="Prompt used to generate the image")
|
|
status: str = Field(default="pending", description="Status of the image generation")
|
|
|
|
class FoodImageCreate(FoodImageBase):
|
|
class Config:
|
|
schema_extra = {
|
|
"example": {
|
|
"image_url": "https://example.com/food-image.jpg",
|
|
"prompt": "A delicious plate of spaghetti carbonara",
|
|
"status": "pending"
|
|
}
|
|
}
|
|
|
|
class FoodImage(FoodImageBase):
|
|
class Config:
|
|
orm_mode = True
|
|
schema_extra = {
|
|
"example": {
|
|
"image_url": "https://example.com/food-image.jpg",
|
|
"prompt": "A delicious plate of spaghetti carbonara",
|
|
"status": "completed"
|
|
}
|
|
} |