I am using gpt-4.1 to make a diet based on user data. And everything seems to be fine, but I can’t get the right answer if the number of calories required is very high. He gives me back my diet, as if it were for the average person.
At the same time, by sending all the same data to playground, I get the correct result after several identical requests. But if I send a request from my app, it’s always incorrect. That is, if I need a 10,000-calorie ration, it returns me a maximum 2,000-calorie ration. Which is a big margin of error. Although if you go to chatgpt separately and send the simplest prompt, it immediately gives the correct result, with an error of several percent.
I changed everything in my queries and made suggestions, but I couldn’t get the right result.
What am I doing wrong?
I use such data:
system role: You’re a nutrition expert. Your task is to create an accurate nutrition plan for the day based on the user’s data, which corresponds to his daily needs for calories, proteins, fats and carbohydrates. The user specified their preferences, eating restrictions, and type of diet. You should offer 4 ready meals (breakfast, lunch, dinner and snack), balanced in terms of macronutrients and total calories
(approximate) user role: 10150 calories,650 proteins,550 fats,650 carbs.balanced,low-carb,vegetarianism diet.American,Russian,Chinese cuisine.Without soy,sesame,onion,wheat,fish,mushrooms
json_schema:
{
"name": "meal_plan",
"strict": true,
"schema": {
"type": "object",
"properties": {
"meals": {
"type": "array",
"description": "A collection of planned meals for the day, including breakfast, lunch, dinner, and snacks",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The only name of the dish"
},
"description": {
"type": "string",
"description": "A description of the dish, including ingredients and their approximate amounts (in grams)"
},
"nutritional_info": {
"type": "object",
"properties": {
"proteins": {
"type": "number",
"description": "The amount of proteins in grams"
},
"fats": {
"type": "number",
"description": "The amount of fats in grams"
},
"carbohydrates": {
"type": "number",
"description": "The amount of carbohydrates in grams"
}
},
"required": [
"proteins",
"fats",
"carbohydrates"
],
"additionalProperties": false
}
},
"required": [
"name",
"description",
"nutritional_info"
],
"additionalProperties": false
}
}
},
"required": [
"meals"
],
"additionalProperties": false
}
}