Add FoodImage schema

This commit is contained in:
Backend IM Bot 2025-03-27 18:47:11 +00:00
parent af74bb7a2a
commit 8c7348ac13

28
schemas/foodimage.py Normal file
View File

@ -0,0 +1,28 @@
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"
}
}