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:
@@ -189,6 +189,27 @@ def get_stats(db: Session = Depends(get_db)):
|
||||
}
|
||||
|
||||
|
||||
@router.post("/trigger-images", status_code=200)
|
||||
def trigger_images(
|
||||
limit: int = 10,
|
||||
missing_only: bool = True,
|
||||
force: bool = False,
|
||||
recipe_id: Optional[UUID] = None,
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
from app.services.image_generation import generate_images_batch
|
||||
|
||||
recipe_ids = [str(recipe_id)] if recipe_id else None
|
||||
result = generate_images_batch(
|
||||
db,
|
||||
recipe_ids=recipe_ids,
|
||||
missing_only=missing_only,
|
||||
force=force,
|
||||
limit=limit,
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
@router.post("/trigger-discovery", status_code=200)
|
||||
def trigger_discovery(
|
||||
family_profile_id: UUID,
|
||||
|
||||
Reference in New Issue
Block a user