Files
healthy-fit/backend/app/models/plan.py
Carlos Escalante 184c8330a7 Add AI-powered nutrition and plan modules
Introduces DSPy-based nutrition and plan generation modules, including image analysis for nutritional info and personalized diet/exercise plans. Adds new API endpoints for health metrics/goals, nutrition image analysis, and plan management. Updates models, schemas, and backend structure to support these features, and includes initial training data and configuration for prompt optimization.
2026-01-18 17:14:56 -06:00

14 lines
551 B
Python

from datetime import datetime
from typing import Optional
from sqlmodel import JSON, Field, SQLModel
class Plan(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
user_id: int = Field(foreign_key="user.id")
goal: str = Field(index=True) # e.g., "lose weight", "gain muscle"
content: str = Field(description="The full plan content in markdown or text")
structured_content: dict = Field(default={}, sa_type=JSON) # For UI rendering
created_at: datetime = Field(default_factory=datetime.utcnow)