jakji93 / airon-fitness

AIRON Fitness is an AI-powered fitness companion supporting your personal health journey by delivering customized fitness and meal plans tailored to your goals and preferences.
https://airon-fitness.onrender.com/
MIT License
3 stars 2 forks source link

[BUG] Schedule update prompt #79

Closed jakji93 closed 11 months ago

jakji93 commented 11 months ago

Update prompt didn't return explicit structure Reenforce JSON struct Parse output as object The following is the return prompt using Postman {\n \"Monday\": {\n \"breakfast\": \"Omelette with vegetables (spinach, bell peppers, onions) and a side of whole wheat toast\",\n \"snack1\": \"Greek yogurt with mixed berries\",\n \"lunch\": \"Grilled chicken breast with quinoa and steamed broccoli\",\n \"snack2\": \"Protein shake with almond milk\",\n \"dinner\": \"Salmon fillet with roasted sweet potatoes and asparagus\",\n \"nutrition_totals\": {\n \"calories\": 1630,\n \"protein\": 110,\n \"carbohydrates\": 120,\n \"fat\": 65\n }\n }\n}

kennyjhcheng commented 11 months ago

Seem like it's not strict enough still, pulled ur new changes and tested using postman with this returned from openAI and the following error obviously as JSON.parse failed

SyntaxError: Unexpected token B in JSON at position 0
    at JSON.parse (<anonymous>)
    at /Users/kennyjhcheng/Documents/UBC Year 4 Summer Semester (2023S)/CPSC 455/airon-fitness/server/src/controllers/mealSchedule/mealScheduleController.js:99:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
SyntaxError: Unexpected token B in JSON at position 0
    at JSON.parse (<anonymous>)
    at /Users/kennyjhcheng/Documents/UBC Year 4 Summer Semester (2023S)/CPSC 455/airon-fitness/server/src/controllers/mealSchedule/mealScheduleController.js:99:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Based on the given information, here is the updated meal schedule with the necessary modifications:

{
  "Monday": {
    "breakfast": "Omelette with vegetables (spinach, bell peppers, onions) and a side of whole wheat toast",
    "snack1": "Greek yogurt with mixed berries",
    "lunch": "Grilled chicken breast with quinoa and steamed broccoli",
    "snack2": "Protein shake with almond milk",
    "dinner": "Salmon fillet with roasted sweet potatoes and asparagus",
    "nutrition_totals": {
      "calories": 1630,
      "protein": 110,
      "carbohydrates": 120,
      "fat": 65
    }
  },
  "Tuesday": {
    "breakfast": "Avocado toast on whole grain bread with a side of sliced tomatoes",
    "snack1": "Hard-boiled eggs",
    "lunch": "Turkey lettuce wraps with hummus and cucumber slices",
    "snack2": "Mixed nuts",
    "dinner": "Lean beef stir-fry with brown rice and mixed vegetables",
    "nutrition_totals": {
      "calories": 1448,
      "protein": 74.3,
      "carbohydrates": 103.6,
      "fat": 82.6
    }
  },
  "Wednesday": {
    "breakfast": "Smoothie made with spinach, banana, almond milk, and protein powder",
    "snack1": "Apple slices with almond butter",
    "lunch": "Grilled shrimp salad with mixed greens, cherry tomatoes, and balsamic vinaigrette",
    "snack2": "Cottage cheese with pineapple chunks",
    "dinner": "Baked chicken thighs with roasted Brussels sprouts and quinoa",
    "nutrition_totals": {
      "calories": 1226,
      "protein": 155,
      "carbohydrates": 131,
      "fat": 51
    }
  },
  "Thursday": {
    "breakfast": "Vegetable omelette with a side of whole wheat toast",
    "snack1": "Greek yogurt with honey",
    "lunch": "Salmon salad with mixed greens, avocado, and lemon dressing",
    "snack2": "Protein bar",
    "dinner": "Grilled tofu with stir-fried vegetables and brown rice",
    "nutrition_totals": {
      "calories": 1700,
      "protein": 100,
      "carbohydrates": 140,
      "fat": 77
    }
  },
  "Friday": {
    "breakfast": "Quinoa porridge with almond milk, topped with berries and nuts",
    "snack1": "Carrot sticks with hummus",
    "lunch": "Chicken and vegetable stir-fry with brown rice noodles",
    "snack2": "Trail mix",
    "dinner": "Baked cod with roasted sweet potatoes and green beans",
    "nutrition_totals": {
      "calories": 1550,
      "protein": 80,
      "carbohydrates": 175,
      "fat": 61
    }
  },
  "Saturday": {
    "breakfast": "Whole grain pancakes with sliced bananas and a drizzle of honey",
    "snack1": "Protein smoothie with almond milk and spinach",
    "lunch": "Turkey and avocado wrap with whole wheat tortilla",
    "snack2": "Greek yogurt with granola",
    "dinner": "Grilled steak with roasted vegetables and quinoa",
    "nutrition_totals": {
      "calories": 1750,
      "protein": 98,
      "carbohydrates": 180,
      "fat": 65
    }
  },
  "Sunday": {
    "breakfast": "Egg white omelette with spinach, mushrooms, and feta cheese",
    "snack1": "Mixed berries with cottage cheese",
    "lunch": "Quinoa salad with grilled chicken, cherry tomatoes, and cucumber",
    "snack2": "Rice cakes with almond butter",
    "dinner": "Baked salmon with steamed asparagus and wild rice",
    "nutrition_totals": {
      "calories": 1380,
      "protein": 105,
      "carbohydrates": 114,
      "fat": 57
    }
  }
}

Please note that since there were no specific allergies, health conditions, or diet restrictions mentioned, the meal schedule remains the same as the original.