Spaces:
Running on Zero
Running on Zero
| """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 | |