internal

Run resolve_custom_item_to_food pipeline (internal testing)

Requires elevated permissions. Exercises search grounding + Food Engine + reconcile LLM, with optional persist and apply_to_meal. Provide either meal_photo_queue_id (full QueueLabelContext) or patient_id. Use imdr_row_index with meal_photo_queue_id to load a real MPQ_IM_LBL_MATCH_V2 row; otherwise send synthetic food/brand/grounding_mode fields.

post/internal/grounding/resolve_custom_item

Request body

apply_to_mealboolean

When true, apply reconciled UPN to meal_item or meal_item_custom_addon.

brandstring nullable
composite_food_idstring nullable
foodstring nullable

Required for synthetic mode (when imdr_row_index is omitted).

grounding_mode'cpg' | 'restaurant' | 'whole_food' nullable

Required for synthetic mode (when imdr_row_index is omitted).

imdr_row_indexinteger nullable

0-based index into MPQ_IM_LBL_MATCH_V2 result; requires meal_photo_queue_id.

is_composite_foodboolean
meal_item_custom_addon_idinteger nullable

Optional custom addon row override when apply_to_meal is true.

meal_item_idinteger nullable

Optional meal row override when apply_to_meal is true.

meal_photo_queue_idinteger nullable

When set, builds QueueLabelContext from this MPQ. Required when imdr_row_index is set.

patient_idinteger nullable

Required when meal_photo_queue_id is omitted; patient used for OpenAI context.

persistboolean

When true, persist v3 grounding_request + outcome.

preparation_methodstring nullable

Stored on the synthetic raw (e.g. cpg, restaurant); defaults to grounding_mode.

Response

successful operation (resolved false if no usable UPN)

appliedboolean required
dedup_skipped_sgboolean required
food_engine_candidatesobject[] nullable
food_engine_ranboolean required
food_engine_selectedobject nullable
food_engine_sourcesstring nullable
grounding_mode'cpg' | 'restaurant' | 'whole_food' required
grounding_request_idinteger nullable
grounding_request_outcome_idinteger nullable
input_summaryobject nullable
meal_item_custom_addon_idinteger nullable
meal_item_idinteger nullable
messagestring nullable
reconciliationobject nullable
resolvedboolean required
search_grounding_resultobject nullable
user_provided_nutritionobject nullable
winner'search_grounding' | 'food_engine' | 'combined' nullable

Changes

No recorded changes to this endpoint across all 1 revision of this API.