mirror of
https://github.com/escalante29/healthy-fit.git
synced 2026-03-21 09:08:46 +01:00
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.
148 lines
5.7 KiB
JSON
148 lines
5.7 KiB
JSON
{
|
|
"extract.predict": {
|
|
"traces": [],
|
|
"train": [],
|
|
"demos": [
|
|
{
|
|
"augmented": true,
|
|
"description": "Blueberry Muffin (Bakery size)",
|
|
"reasoning": "A typical bakery-sized blueberry muffin is generally larger than a standard homemade muffin and is made from ingredients such as flour, sugar, butter, eggs, milk, blueberries, and baking powder. The estimated calorie count for a large blueberry muffin is about 400-500 calories, primarily derived from carbohydrates (mainly from flour and sugar), fats (from butter), and a moderate amount of protein. \n\nFor nutritional breakdown:\n- Carbs: Approximately 60g derived from the flour and sugar.\n- Fats: Approximately 20g from the butter.\n- Protein: Roughly 6g from the flour and egg content.\n- The muffin may also contain vitamins and minerals from the blueberries.\n\nOverall, a bakery-sized blueberry muffin is calorie-dense due to the combination of ingredients used, especially sugar and butter.",
|
|
"nutritional_info": {
|
|
"reasoning": "Bakery-sized muffin has ingredients like flour, sugar, butter, and blueberries. Estimated 450 cal, with ~60g carbs, ~20g fat, and ~6g protein.",
|
|
"name": "Blueberry Muffin",
|
|
"calories": 450.0,
|
|
"protein": 6.0,
|
|
"carbs": 60.0,
|
|
"fats": 20.0,
|
|
"micros": null
|
|
}
|
|
},
|
|
{
|
|
"description": "Philly Cheesesteak",
|
|
"nutritional_info": {
|
|
"reasoning": "Roll (250 cal). Fatty steak (400 cal). Cheese whiz/provolone (150 cal). Oil (100 cal).",
|
|
"name": "Cheesesteak",
|
|
"calories": 900.0,
|
|
"protein": 40.0,
|
|
"carbs": 50.0,
|
|
"fats": 55.0,
|
|
"micros": null
|
|
}
|
|
},
|
|
{
|
|
"description": "Grilled salmon with asparagus and roasted potatoes",
|
|
"nutritional_info": {
|
|
"reasoning": "6oz Salmon fillet (350 cal). Oil for cooking (60 cal). Asparagus (30 cal) + oil (30 cal). 1 cup roasted potatoes (150 cal) + oil (60 cal). Total ~680 cal.",
|
|
"name": "Salmon Dinner",
|
|
"calories": 680.0,
|
|
"protein": 40.0,
|
|
"carbs": 25.0,
|
|
"fats": 45.0,
|
|
"micros": null
|
|
}
|
|
},
|
|
{
|
|
"description": "Tacos - 3 beef tacos with cheese and sour cream",
|
|
"nutritional_info": {
|
|
"reasoning": "3 corn tortillas (150 cal). Ground beef filling (250 cal - cooked with fat). Cheese (110 cal). Sour cream (60 cal). Total ~570 cal.",
|
|
"name": "Beef Tacos",
|
|
"calories": 570.0,
|
|
"protein": 25.0,
|
|
"carbs": 45.0,
|
|
"fats": 30.0,
|
|
"micros": null
|
|
}
|
|
}
|
|
],
|
|
"signature": {
|
|
"instructions": "Extract nutritional information from a food description.\n\nYou must first provide a detailed step-by-step reasoning analysis of the ingredients,\nportions, AND preparation methods (cooking oils, butter, sauces) before estimating values.\nVerify if the caloric totals match the sum of macros (multiplying protein/carbs by 4, fats by 9).",
|
|
"fields": [
|
|
{
|
|
"prefix": "Description:",
|
|
"description": "Description of the food or meal"
|
|
},
|
|
{
|
|
"prefix": "Reasoning: Let's think step by step in order to",
|
|
"description": "${reasoning}"
|
|
},
|
|
{
|
|
"prefix": "Nutritional Info:",
|
|
"description": "Nutritional information with reasoning"
|
|
}
|
|
]
|
|
},
|
|
"lm": null
|
|
},
|
|
"analyze_image.predict": {
|
|
"traces": [],
|
|
"train": [],
|
|
"demos": [
|
|
{
|
|
"description": "Philly Cheesesteak",
|
|
"nutritional_info": {
|
|
"reasoning": "Roll (250 cal). Fatty steak (400 cal). Cheese whiz/provolone (150 cal). Oil (100 cal).",
|
|
"name": "Cheesesteak",
|
|
"calories": 900.0,
|
|
"protein": 40.0,
|
|
"carbs": 50.0,
|
|
"fats": 55.0,
|
|
"micros": null
|
|
}
|
|
},
|
|
{
|
|
"description": "Grilled salmon with asparagus and roasted potatoes",
|
|
"nutritional_info": {
|
|
"reasoning": "6oz Salmon fillet (350 cal). Oil for cooking (60 cal). Asparagus (30 cal) + oil (30 cal). 1 cup roasted potatoes (150 cal) + oil (60 cal). Total ~680 cal.",
|
|
"name": "Salmon Dinner",
|
|
"calories": 680.0,
|
|
"protein": 40.0,
|
|
"carbs": 25.0,
|
|
"fats": 45.0,
|
|
"micros": null
|
|
}
|
|
},
|
|
{
|
|
"description": "Tacos - 3 beef tacos with cheese and sour cream",
|
|
"nutritional_info": {
|
|
"reasoning": "3 corn tortillas (150 cal). Ground beef filling (250 cal - cooked with fat). Cheese (110 cal). Sour cream (60 cal). Total ~570 cal.",
|
|
"name": "Beef Tacos",
|
|
"calories": 570.0,
|
|
"protein": 25.0,
|
|
"carbs": 45.0,
|
|
"fats": 30.0,
|
|
"micros": null
|
|
}
|
|
}
|
|
],
|
|
"signature": {
|
|
"instructions": "Analyze the food image to estimate nutritional content.\n\n1. Identify all food items and estimated portion sizes.\n2. CRITICAL: Account for hidden calories from cooking fats, oils, and sauces (searing, frying).\n3. Reason step-by-step about the total composition before summing macros.",
|
|
"fields": [
|
|
{
|
|
"prefix": "Image:",
|
|
"description": "The food image"
|
|
},
|
|
{
|
|
"prefix": "Description:",
|
|
"description": "Additional user description"
|
|
},
|
|
{
|
|
"prefix": "Reasoning: Let's think step by step in order to",
|
|
"description": "${reasoning}"
|
|
},
|
|
{
|
|
"prefix": "Nutritional Info:",
|
|
"description": "Nutritional information with reasoning"
|
|
}
|
|
]
|
|
},
|
|
"lm": null
|
|
},
|
|
"metadata": {
|
|
"dependency_versions": {
|
|
"python": "3.11",
|
|
"dspy": "3.1.0",
|
|
"cloudpickle": "3.1"
|
|
}
|
|
}
|
|
}
|