s
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<title>NutriAI Elite v22.0</title>
|
<title>NutriAI Elite v23.0</title>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
@@ -114,8 +114,8 @@
|
|||||||
|
|
||||||
<div id="chat" class="chat-container">
|
<div id="chat" class="chat-container">
|
||||||
<div class="msg ai shadow">
|
<div class="msg ai shadow">
|
||||||
<h5 class="fw-bold text-primary">System Refined.</h5>
|
<h5 class="fw-bold text-primary">Precision Sync Active.</h5>
|
||||||
Shopping lists will only be generated upon button request. All units are synced.
|
The AI is now strictly calibrated to use **DRY/RAW weights** for all ingredient measurements and calorie counts.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -185,11 +185,11 @@
|
|||||||
async function talk(custom) {
|
async function talk(custom) {
|
||||||
const box = document.getElementById('chat'), input = document.getElementById('uIn');
|
const box = document.getElementById('chat'), input = document.getElementById('uIn');
|
||||||
const isShopReq = custom === 'GENERATE_SHOPPING_LIST';
|
const isShopReq = custom === 'GENERATE_SHOPPING_LIST';
|
||||||
const text = isShopReq ? "Please generate a shopping list for the current meal plan." : (custom || input.value);
|
const text = isShopReq ? "Generate a shopping list based on the current plan." : (custom || input.value);
|
||||||
if(!text) return;
|
if(!text) return;
|
||||||
|
|
||||||
if(!custom) { box.innerHTML += `<div class="msg user shadow-sm">${text}</div>`; input.value=""; }
|
if(!custom) { box.innerHTML += `<div class="msg user shadow-sm">${text}</div>`; input.value=""; }
|
||||||
const id = 'ai-'+Date.now(); box.innerHTML += `<div id="${id}" class="msg ai shadow">Processing...</div>`;
|
const id = 'ai-'+Date.now(); box.innerHTML += `<div id="${id}" class="msg ai shadow">Calculating with RAW weights...</div>`;
|
||||||
box.scrollTop = box.scrollHeight;
|
box.scrollTop = box.scrollHeight;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -198,10 +198,11 @@
|
|||||||
body: JSON.stringify({ model:"llama-3.3-70b-versatile", messages:[
|
body: JSON.stringify({ model:"llama-3.3-70b-versatile", messages:[
|
||||||
{role:"system", content: `Expert Nutritionist. Target: ${document.getElementById('kcal').innerText} kcal. SYSTEM: ${isMetric ? 'METRIC' : 'IMPERIAL'}.
|
{role:"system", content: `Expert Nutritionist. Target: ${document.getElementById('kcal').innerText} kcal. SYSTEM: ${isMetric ? 'METRIC' : 'IMPERIAL'}.
|
||||||
MANDATORY RULES:
|
MANDATORY RULES:
|
||||||
1. ALWAYS use raw weights for ingredients in meal plans.
|
1. ALWAYS use DRY/RAW weights for ingredients (e.g., 100g raw oats = ~380kcal, NOT 100g cooked).
|
||||||
2. DO NOT generate a shopping list unless the user explicitly asks for one.
|
2. Explicitly label weights as "(dry)" or "(raw)" in the meal plan tables.
|
||||||
3. If requested, provide shopping list quantities in ${isMetric ? 'grams/kilograms' : 'ounces/lbs'}.
|
3. DO NOT generate a shopping list unless requested via "GENERATE_SHOPPING_LIST".
|
||||||
4. Use Markdown tables.`},
|
4. If requested, provide shopping list quantities in ${isMetric ? 'grams/kilograms' : 'ounces/lbs'}.
|
||||||
|
5. Format response in Markdown tables.`},
|
||||||
{role:"user", content:text}
|
{role:"user", content:text}
|
||||||
]})
|
]})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user