Twinkle HubTwinkle Hub

Total nutrition of a meal (food→grams)

tw_analyze_meal_nutrition

Health & food · same family🇹🇼 Taiwanread-only

關鍵字 / Keywords: 餐點營養分析 總熱量 三大營養素 meal nutrition analyze calories macros

給定一頓餐 (食物名 → 克數), 算總營養成分.

Args: meal: {"雞蛋": 50, "白米": 150, "豬肉": 80} — values in grams nutrients: 要算的營養素 list (default 8 個: 粗蛋白/粗脂肪/總碳水 /熱量/鈉/鈣/鐵/膳食纖維). 自動 alias. limit_per_food: 每食物 candidate 數 (default 30, 給多 variant 食物用)

Returns: {input_meal, matched_foods, total, ambiguous, unmatched, disclaimer} - total: 餐點總計各營養素數值 - ambiguous: 有多重 match 的食物 (best match 是 row 數最多者) - unmatched: 沒 match 的食物 (corpus 沒有)

典型用例: tw_analyze_meal_nutrition({"雞蛋": 50, "白米": 150}) tw_analyze_meal_nutrition({"豆腐": 100, "高麗菜": 80}, nutrients=["蛋白質", "鈉", "鈣"])

Parameters

ParamTypeDescription
meal *object—
nutrientsarray—
limit_per_foodinteger—
Raw JSON schema
{
  "properties": {
    "meal": {
      "additionalProperties": true,
      "title": "Meal",
      "type": "object"
    },
    "nutrients": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Nutrients"
    },
    "limit_per_food": {
      "default": 30,
      "title": "Limit Per Food",
      "type": "integer"
    }
  },
  "required": [
    "meal"
  ],
  "title": "tw_analyze_meal_nutritionArguments",
  "type": "object",
  "additionalProperties": false
}

How to call

Starter — params in the table above
tw_analyze_meal_nutrition({ meal: "…" })