Twinkle HubTwinkle Hub

餐點總營養分析 (給食物+克數)

tw_analyze_meal_nutrition

医療・​食品 · 9 件🇹🇼 台湾読み取り専用

關鍵字 / 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=["蛋白質", "鈉", "鈣"])

パラメータ

名前説明
meal *object
nutrientsarray
limit_per_foodinteger
生の 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"
}

呼び出し方

スターター——パラメータは​上表参照
tw_analyze_meal_nutrition({ meal: "…" })