export const ai = { identifyFoodFromPhoto: `Analyze this food image and identify ALL separate food items visible. For EACH distinct item, provide: - foodName: The food item name - hpPredIngredients: ingredients you are confident are present - hrPredIngredients: ingredients that might be present but you're less certain about - boundingBox: Normalized coordinates (0-1 range) for the item location { x, y, width, height } where x,y is top-left corner - confidence: Confidence score 0-1 Return a JSON object with an "items" array. Example: { "items": [ {"foodName": "Bulgogi", "hpPredIngredients": ["beef", "onion", "sesame"], "hrPredIngredients": ["garlic", "sugar"], "boundingBox": {"x": 0.1, "y": 0.1, "width": 0.4, "height": 0.4}, "confidence": 0.95}, {"foodName": "Kimchi", "hpPredIngredients": ["napa cabbage", "gochugaru"], "hrPredIngredients": ["garlic", "fish sauce"], "boundingBox": {"x": 0.5, "y": 0.2, "width": 0.3, "height": 0.3}, "confidence": 0.9} ] } Return ONLY valid JSON, no other text.`, identifyItemFromCrop: `You are a food identification AI. Analyze the food and provide 2-3 possible interpretations (candidates), ranked by likelihood. IMPORTANT: Always provide at least 2 candidates when the protein/filling is not clearly visible (e.g., tacos, burritos, dumplings, fried rice, curry, noodles, sandwiches, wraps). Different proteins or preparations should be separate candidates. For each candidate, split ingredients into: - hpPredIngredients: ingredients you are confident are present - hrPredIngredients: ingredients that might be present but you're less certain about Return a JSON object with: - candidates: Array of up to 3 candidates, each with { foodName, hpPredIngredients, hrPredIngredients } Example response: { "candidates": [ {"foodName": "Beef Taco", "hpPredIngredients": ["tortilla", "beef", "lettuce"], "hrPredIngredients": ["sour cream", "cheese", "tomato"]}, {"foodName": "Pork Taco", "hpPredIngredients": ["tortilla", "pork", "lettuce"], "hrPredIngredients": ["sour cream", "cheese", "tomato"]} ] } Return ONLY valid JSON, no other text.`, identifyIngredients: (foodName: string, hasImage: boolean) => `For the food item "${foodName}", analyze ${hasImage ? 'the image and ' : ''}provide ingredients split by confidence. Return a JSON object with: - hpPredIngredients: ingredients you are confident are in this item - hrPredIngredients: ingredients that might be present but you're less certain about Keep each list to 3-8 ingredients. Return ONLY valid JSON.`, estimateNutrition: ( foodName: string, ingredients: string[], allNutrients: string, dgaNutrients: string ) => `Estimate nutritional values for one serving of: ${foodName} Ingredients: ${ingredients.join(', ')} Return a JSON object with: - novaClass: NOVA food classification (1=unprocessed, 2=processed culinary, 3=processed, 4=ultra-processed) - nutrition: Estimated nutritional values per serving. Include all nutrients that apply. Available nutrient fields: ${allNutrients} USDA Dietary Guidelines food group equivalents: ${dgaNutrients} DGA estimation guide: - usa_gov_dga_vegetables_cup_eq: 1 cup raw leafy = 0.5, 1 cup other veg = 1 - usa_gov_dga_fruits_cup_eq: 1 medium fruit = 1, 1/4 cup dried = 0.5 - usa_gov_dga_dairy_cup_eq: 1 cup milk/yogurt = 1, 1.5 oz cheese = 1 - usa_gov_dga_whole_grains_oz_eq: 1 slice bread = 1, 1/2 cup cooked grain = 1 - usa_gov_dga_healthy_fats_tsp_eq: 1 tbsp oil = 3, 1 oz nuts = 3 Example: {"novaClass": 3, "nutrition": {"kcal": 450, "protein_g": 25, "carbs_g": 35, "fat_g": 20, "fiber_g": 4, "vitamin_d_mcg": 2, "omega_3_mg": 100, "usa_gov_dga_vegetables_cup_eq": 0.5}} Return ONLY valid JSON.`, recommendIngredients: (params: { days: number; gapLines: string; recentIngredients: string; restrictions: string; preferences: string; conditions: string; }) => `You are a nutrition expert. Based on ${params.days}-day nutrition data, recommend ingredients and recipes. **${params.days}-Day Nutrition Deficiencies** (sorted by health impact): ${params.gapLines} **Recently Eaten (AVOID recommending these)**: ${params.recentIngredients} **User Profile**: - Food restrictions: ${params.restrictions} - Food preferences: ${params.preferences} - Health conditions: ${params.conditions} **Task**: 1. List 15-25 ingredients that address these deficiencies 2. IMPORTANT: Do NOT recommend ingredients the user recently ate (listed above) 3. Sort ingredients so eating top N provides maximum health benefit 4. Suggest 5 menu ideas using those ingredients (can be recipes to cook at home or dishes to order when eating out) **Format**: Return valid JSON only, no markdown {"ingredients":["..."],"foods":[{"name":"...","ingredients":["..."]}]}`, judgePredictions: (candidateCount: number, candidateDescriptions: string) => `You are an expert food critic judging AI food identification accuracy. I will show you a photo and ${candidateCount} descriptions generated by different AI models. Which description best matches the photo? Candidates: ${candidateDescriptions} Return EXACTLY this format: Winner: Report: `, };