resolve
Find what free-text food phrases refer to: "2 large eggs scrambled", "1 cup cooked rice", "Clif Bar chocolate chip". Batch up to 50 phrases. Default mode "candidates" returns, per phrase, the parsed amount and ranked candidates, each with its portions (label and grams), the amount in grams when the phrase states it exactly ("150 g", "1 cup", "2 large"), and, if you pass fields, values for that amount (or per 100 g / per serving when no amount is stated), each with its proof rank and source; a field with no value is null with the reason. The first candidate is the selection (selected: true) with an amount; "assumed" lists what the phrase did not say ("item": other close matches exist; "portion": a typical size was taken, other_sizes lists the rest). Answer from it, or choose another candidate or portion. Mode "pick" returns only the selection, with the same "assumed".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | candidates | |
| kinds | No | ||
| limit | No | Candidates per phrase. | |
| texts | Yes | ||
| fields | No | Only return these nutrient keys (e.g. ["energy","protein"]). Saves tokens. A group name returns every key under it, each as its own value in its own unit, never added or converted: "vitamin_a" gives vitamin_a.rae (µg) and vitamin_a.iu (IU); "carbohydrate" gives carbohydrate.total (includes fibre), carbohydrate.available (excludes it) and carbohydrate.available_mse. A key that is itself a registry key (e.g. "fat") is just that key. A name that matches nothing comes back missing with the closest keys. | |
| locale | No | BCP 47 locale, e.g. en-US, en-GB, ja-JP. Decides household measure sizes (a US cup is 236.6 ml, a metric cup 250 ml). | |
| market | No | ISO 3166-1 country where the item is sold or eaten, e.g. US, GB, JP. | |
| regime | No | With fields: add values derivable for this regime (e.g. EU adds salt from sodium). | |
| portions | No | Portions per candidate. |