TrackUp Food Analyze
Use this skill to analyze a food image with:
- - INLINECODE0
- INLINECODE1
- INLINECODE2
- INLINECODE3
- INLINECODE4
Rules
- - Always use INLINECODE5
- Always send INLINECODE6
- Image analysis requests must contain
image_url or INLINECODE8 - If both exist,
image_base64 wins - INLINECODE10 must be raw base64 without INLINECODE11
- For complete food image analysis, call
AnalyzeWholeFood directly - Only call a specialized image-analysis API when the user explicitly asks for one specific analysis dimension
- Use
ExtractFoodMacros for basic macro extraction - Use
AnalyzeIngredients for deep ingredient and metabolic analysis - Use
GetHealthInsight for professional health insight - INLINECODE16 request body must contain INLINECODE17
- INLINECODE18 returns at most the first
20 results
API Selection
Choose the API based on the user's intent:
- 1. Full food analysis: INLINECODE20
- Basic macro extraction only: INLINECODE21
- Deep ingredient and metabolic analysis only: INLINECODE22
- Professional health insight only: INLINECODE23
- Keyword-based lookup without image analysis: INLINECODE24
Food Search
Use SearchFood when the user wants keyword-based food lookup instead of image analysis.
Request example:
CODEBLOCK0
Expected response shape:
CODEBLOCK1
Local Image Workflow
Convert local image to base64:
CODEBLOCK2
Build payload:
CODEBLOCK3
Call full food analysis directly:
CODEBLOCK4
Proxy Fix
If curl incorrectly tries a local proxy like 127.0.0.1:7890, retry with:
CODEBLOCK5
Response Fields
INLINECODE28 :
- - INLINECODE29
- INLINECODE30
- INLINECODE31
- INLINECODE32
- INLINECODE33
- INLINECODE34
- INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39
- INLINECODE40
INLINECODE41 :
- - INLINECODE42
- INLINECODE43
- INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
INLINECODE48 :
- - INLINECODE49
- INLINECODE50
- INLINECODE51
- INLINECODE52
INLINECODE53 :
- - INLINECODE54
- INLINECODE55
INLINECODE56 :
- - INLINECODE57
- INLINECODE58
- INLINECODE59
- INLINECODE60
INLINECODE61 meaning:
- -
1-5 score generated by AI food evaluation - INLINECODE63 is the highest score
- Use it to help users make nutritionally informed choices
Output Rules
- - Keep numeric values exactly as returned
- Do not invent missing fields
- For complete image analysis, use
AnalyzeWholeFood as the default API - For specialized analysis, use only the dedicated API that matches the user's request
- For
SearchFood, return the foods in API order and do not claim more than 20 items unless the response actually contains them
Common Errors
- - INLINECODE67
- INLINECODE68
- INLINECODE69
- INLINECODE70
- INLINECODE71
- INLINECODE72
技能名称: trackup-food-analyze
详细描述:
TrackUp 食物分析
使用此技能分析食物图片,需调用以下接口:
- - https://deepeat.ai/step.aispark.api.API/AnalyzeWholeFood
- https://deepeat.ai/step.aispark.api.API/ExtractFoodMacros
- https://deepeat.ai/step.aispark.api.API/AnalyzeIngredients
- https://deepeat.ai/step.aispark.api.API/GetHealthInsight
- https://deepeat.ai/step.aispark.api.API/SearchFood
规则
- - 始终使用 POST 方法
- 始终设置 Content-Type: application/json
- 图片分析请求必须包含 imageurl 或 imagebase64
- 若两者同时存在,优先使用 imagebase64
- imagebase64 必须为原始 base64 编码,不含 data:image/...;base64, 前缀
- 如需完整的食物图片分析,直接调用 AnalyzeWholeFood
- 仅当用户明确要求某一特定分析维度时,才调用对应的专项图片分析接口
- 基础营养素提取使用 ExtractFoodMacros
- 深度成分与代谢分析使用 AnalyzeIngredients
- 专业健康洞察使用 GetHealthInsight
- SearchFood 请求体必须包含 keyword
- SearchFood 最多返回前 20 条结果
接口选择
根据用户意图选择接口:
- 1. 完整食物分析:AnalyzeWholeFood
- 仅基础营养素提取:ExtractFoodMacros
- 仅深度成分与代谢分析:AnalyzeIngredients
- 仅专业健康洞察:GetHealthInsight
- 基于关键词查询(无需图片分析):SearchFood
食物搜索
当用户希望进行基于关键词的食物查询而非图片分析时,使用 SearchFood。
请求示例:
bash
curl --silent --show-error --location \
https://deepeat.ai/step.aispark.api.API/SearchFood \
--header Content-Type: application/json \
--data {
keyword: banana
}
预期响应格式:
json
{
foods: [
{
food_name: 香蕉,
calories_cal: 89000,
weight_g: 100,
carbs_g: 22.8,
proteins_g: 1.1,
fats_g: 0.3,
display_gi: 51,
brand:
}
],
pagination: {
size: 20,
page: 1,
total: 123
}
}
本地图片处理流程
将本地图片转换为 base64 编码:
bash
base64 < /absolute/path/to/image.jpg | tr -d \n > /tmp/food_image.b64
构建请求体:
bash
printf {imagebase64: > /tmp/foodimage.json
cat /tmp/foodimage.b64 >> /tmp/foodimage.json
printf } >> /tmp/food_image.json
直接调用完整食物分析接口:
bash
curl --silent --show-error --location \
https://deepeat.ai/step.aispark.api.API/AnalyzeWholeFood \
--header Content-Type: application/json \
--data-binary @/tmp/food_image.json
代理修复
如果 curl 错误地尝试使用本地代理(如 127.0.0.1:7890),请使用以下命令重试:
bash
env -u httpproxy -u httpsproxy -u HTTPPROXY -u HTTPSPROXY -u ALL_PROXY curl ...
响应字段
AnalyzeWholeFood:
- - foodname
- totalweightg
- totalcalorieskcal
- carbsg
- proteinsg
- fatsg
- displaygi
- dietaryfiberg
- sugarg
- ingredients[]
- healthscore
- healthprofile
ExtractFoodMacros:
- - foodname
- totalweightg
- totalcalorieskcal
- carbsg
- proteinsg
- fatsg
AnalyzeIngredients:
- - displaygi
- dietaryfiberg
- sugarg
- ingredients[]
GetHealthInsight:
- - healthscore
- healthprofile
SearchFood:
- - foods[]
- pagination.page
- pagination.size
- pagination.total
health_score 含义:
- - 由 AI 食物评估生成的 1-5 分
- 5 分为最高分
- 用于帮助用户做出营养均衡的选择
输出规则
- - 保持数值与返回结果完全一致
- 不要自行补充缺失字段
- 对于完整的图片分析,默认使用 AnalyzeWholeFood 接口
- 对于专项分析,仅使用与用户请求匹配的专用接口
- 对于 SearchFood,按接口返回顺序展示食物列表,除非响应中确实包含超过 20 条,否则不要声称超过 20 条
常见错误
- - 400 invalidrequest
- 422 foodnotrecognized
- 422 barcodeonlyresult
- 429 ratelimitexceeded
- 500 internalerror
- 502 upstreamflowerror