Public Access
feat(backend): wire exclude_recipe_ids, verify MealPlan votes schema, add image generation service
- api/meal_plans.py: /regenerate now passes exclude_recipe_ids into generate_meal_plan - planner/generate.py: filter recipe_dicts by exclude_recipe_ids set - image_generation.py: OpenAI gpt-image-1 client with prompt building, b64_json handling - main.py: StaticFiles mount at /static for generated images - admin.py: POST /api/admin/trigger-images endpoint for batch generation - scripts/generate_images.py: CLI for batch image generation - docker-compose.yml + nginx: volume mounts for static/images persistence - Verify MealPlanItem.votes ↔ MealPlanVote relationship is correct; no model bug exists
This commit is contained in:
@@ -100,6 +100,7 @@ def generate_meal_plan(
|
||||
week_start_date: date,
|
||||
config: PlannerConfig = DEFAULT,
|
||||
today: Optional[date] = None,
|
||||
exclude_recipe_ids: Optional[Set[UUID]] = None,
|
||||
) -> GenerationResult:
|
||||
today = today or date.today()
|
||||
family = db.query(FamilyProfile).filter(FamilyProfile.id == family_id).first()
|
||||
@@ -107,6 +108,7 @@ def generate_meal_plan(
|
||||
raise ValueError(f"family_profile {family_id} not found")
|
||||
|
||||
recipes = db.query(Recipe).all()
|
||||
exclude_set = exclude_recipe_ids or set()
|
||||
recipe_dicts = [
|
||||
{
|
||||
"id": r.id,
|
||||
@@ -120,6 +122,7 @@ def generate_meal_plan(
|
||||
"servings": r.servings or 4,
|
||||
}
|
||||
for r in recipes
|
||||
if r.id not in exclude_set
|
||||
]
|
||||
|
||||
recipe_ingredient_ids: Dict[UUID, Set[UUID]] = {}
|
||||
|
||||
Reference in New Issue
Block a user