Spaces:
Running on Zero
Running on Zero
File size: 854 Bytes
75c5414 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | """Shared data models for the Cook-with-Me pipeline."""
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Field
class DishOption(BaseModel):
name: str
why: str = ""
class RecipeStep(BaseModel):
n: int = 1
instruction: str
duration: str = "5 min"
tip: Optional[str] = None
visual: str = ""
image_path: Optional[str] = None
image_b64: Optional[str] = None # base64 PNG from FLUX
class Recipe(BaseModel):
name: str
cuisine: str = "International"
servings: int = 2
total_time_minutes: int = 30
steps: list[RecipeStep] = Field(default_factory=list)
nutrition: dict = Field(default_factory=dict)
final_dish_visual: str = ""
final_dish_image_path: Optional[str] = None
final_dish_image_b64: Optional[str] = None # base64 PNG from FLUX
|