Add FoodImage schema
This commit is contained in:
parent
af74bb7a2a
commit
8c7348ac13
28
schemas/foodimage.py
Normal file
28
schemas/foodimage.py
Normal 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"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user