From 8c7348ac13dbc7c75faca1e8279158b26987a70e Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 18:47:11 +0000 Subject: [PATCH] Add FoodImage schema --- schemas/foodimage.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 schemas/foodimage.py diff --git a/schemas/foodimage.py b/schemas/foodimage.py new file mode 100644 index 0000000..6b76071 --- /dev/null +++ b/schemas/foodimage.py @@ -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" + } + } \ No newline at end of file