curl --request POST \
--url https://api.example.com/api/ml/recommend \
--header 'Content-Type: application/json' \
--data '
{
"Nutritional similarity": {},
"Diet compatibility": {},
"Meal type matching": {},
"Exclusion logic": {}
}
'{
"recommendations": [
{
"id": 123,
"recipe_id": 123,
"name": "<string>",
"calories": 123,
"protein": 123,
"carbs": 123,
"fat": 123,
"similarity_score": 123,
"meal_types": [
{}
],
"diet_types": [
{}
],
"image_url": "<string>",
"recipe_url": "<string>"
}
]
}curl --request POST \
--url https://api.example.com/api/ml/recommend \
--header 'Content-Type: application/json' \
--data '
{
"Nutritional similarity": {},
"Diet compatibility": {},
"Meal type matching": {},
"Exclusion logic": {}
}
'{
"recommendations": [
{
"id": 123,
"recipe_id": 123,
"name": "<string>",
"calories": 123,
"protein": 123,
"carbs": 123,
"fat": 123,
"similarity_score": 123,
"meal_types": [
{}
],
"diet_types": [
{}
],
"image_url": "<string>",
"recipe_url": "<string>"
}
]
}curl -X POST https://api.smarteat.ai/api/chat/ \
-H "Authorization: Bearer <token>" \
-d 'message=Suggest a high-protein breakfast for tomorrow'
features = [
'calories', # Total caloric content
'protein', # Protein in grams
'carbs', # Carbohydrates in grams
'fat' # Fat in grams
]
# Features are normalized using StandardScaler
# This ensures equal weight across different scales
# Model configuration
n_neighbors = 550 # Search space size (configurable)
metric = 'euclidean' # Distance calculation method
# The model finds the closest recipes in the scaled feature space
# then filters by diet and meal type constraints
Show Recipe recommendation