Cool use of AI for analyzing a meal

Just sharing a little feature that makes use of the ‘Complete Chat’ AI integration. The App sends an image of some food along with a prompt that asks for a descriptive title, visible ingredients and then an estimate of some nutritional info. I ask the output to be in JSON so that I can easily handle the data.

I’m impressed with how meticulous it is at identifying ingredients… and for this use case the data is accurate enough. Nice job Glide!

18 Likes

Amazing work Simon!

1 Like

Great work!

1 Like

This is so cool! Thank you for sharing.

1 Like

This is very cool! I want to create something similar.
Did you use the openAI integration to do this? I can’t find an option to send an image with a prompt to OpenAI.

1 Like

The “Complete chat” action allows you to do that.

2 Likes

Thanks for sharing!

1 Like

@Simon_Hill Curious, what prompt did you use to obtain the nutritional info? Something generic or specific?

Here you go:

1 Like

Awesome, TY!

Would you mind pasting it as text so I can copy?

Sure here you go. This took quite a few iterations to figure out a stable version… :slight_smile:

Please generate a JSON object with the following structure, using the attached meal description:

{
“Title”: “A descriptive title for the recipe”,
“NutritionalEstimates”: {
“Calories”: Estimated amount of calories in kcal without quotes,
“Fat”: Estimated amount of fat in grams without quotes,
“Carbs”: Estimated amount of carbohydrates in grams without quotes,
“Protein”: Estimated amount of protein in grams without quotes,
“Sugar”: Estimated amount of sugar in grams without quotes
},
“Ingredients”: [
“First ingredient”,
“Second ingredient”,
// Add additional visible ingredients here
]
}

Make sure that the numerical values for “Calories”, “Fat”, “Carbs”, “Protein”, and “Sugar” are given as numbers without quotes. Provide the JSON object as a direct response without any additional comments or annotations - only output the JSON object and do not include ```json

3 Likes

Thanks, I will definitely play around with this!

Funny, I already had a nutrition prompt and after adding yours , they produce different results :rofl:. Ill have to enter into a tracking app and see which results are more accurate.

2 Likes