FoodRecipeSuggestion food.recipe-suggestion@1

Generated at from openvibe-contracts v0.150.0 and openvibe-sdk v0.44.0.

Version
1.0.0
Owner
food
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/food/recipe-suggestion.v1.json

food.recipe-suggestion@1: one stored answer (the last 20 a person are kept). Ingredients are from the pantry or cite the food-list rows Food sent the workflow; to_buy and to_buy_cost are Food's own typical prices, never the model's. A recipe is AI-suggested and labelled so on the page.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^rcp_[0-9A-HJKMNP-TV-Z]{26}$
created_atstringyes
  • format date-time
askstring | nullyes
  • maxLength 500
peopleinteger | nullyes
  • minimum 1
  • maximum 12
ai_run_idstring | nullyes
recipesarray of objectyes
  • maxItems 3
  • items: no other fields
recipes[].titlestringyes
  • maxLength 160
recipes[].servesinteger | null
  • minimum 1
  • maximum 12
recipes[].minutesinteger | null
  • minimum 1
  • maximum 600
recipes[].ingredientsarray of objectyes
  • minItems 1
  • maxItems 25
  • items: no other fields
recipes[].ingredients[].namestringyes
  • maxLength 120
recipes[].ingredients[].amountstring | nullyes
  • maxLength 80
recipes[].ingredients[].from_pantrybooleanyes
recipes[].ingredients[].citationsarray of integeryes
  • items: minimum 0
recipes[].stepsarray of stringyes
  • minItems 1
  • maxItems 20
  • items: maxLength 600
recipes[].notesstring | null
  • maxLength 600
recipes[].to_buyarray of objectyes
  • items: no other fields
recipes[].to_buy[].slugstringyes
recipes[].to_buy[].namestringyes
recipes[].to_buy[].pricenumber | nullyes
  • minimum 0
recipes[].to_buy_costnumberyes
  • minimum 0
recipes[].to_buy_cost_partialboolean
recipes[].cost_notestringyes

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: one
{
  "id": "rcp_01JQ8Z0000000000000000000C",
  "created_at": "2026-10-12T05:25:14.000Z",
  "ask": "something quick",
  "people": 2,
  "ai_run_id": "run_01JQ8Z0000000000000000000D",
  "recipes": [
    {
      "title": "Egg fried rice",
      "serves": 2,
      "minutes": 15,
      "ingredients": [
        {
          "name": "Eggs",
          "amount": "3",
          "from_pantry": true,
          "citations": []
        },
        {
          "name": "White rice",
          "amount": "2 cups cooked",
          "from_pantry": false,
          "citations": [
            1
          ]
        }
      ],
      "steps": [
        "Scramble the eggs and set them aside.",
        "Fry the rice, stir the eggs back in and serve."
      ],
      "notes": null,
      "to_buy": [
        {
          "slug": "rice-long-grain",
          "name": "Long Grain White Rice (2 lb)",
          "price": 1.25
        }
      ],
      "to_buy_cost": 1.25,
      "to_buy_cost_partial": false,
      "cost_note": "Cost is an estimate from typical prices, not a live price."
    }
  ]
}
Rejected: four-recipes
{
  "id": "rcp_01JQ8Z0000000000000000000C",
  "created_at": "2026-10-12T05:25:14.000Z",
  "ask": "something quick",
  "people": 2,
  "ai_run_id": "run_01JQ8Z0000000000000000000D",
  "recipes": [
    {
      "title": "Egg fried rice",
      "serves": 2,
      "minutes": 15,
      "ingredients": [
        {
          "name": "Eggs",
          "amount": "3",
          "from_pantry": true,
          "citations": []
        },
        {
          "name": "White rice",
          "amount": "2 cups cooked",
          "from_pantry": false,
          "citations": [
            1
          ]
        }
      ],
      "steps": [
        "Scramble the eggs and set them aside.",
        "Fry the rice, stir the eggs back in and serve."
      ],
      "notes": null,
      "to_buy": [
        {
          "slug": "rice-long-grain",
          "name": "Long Grain White Rice (2 lb)",
          "price": 1.25
        }
      ],
      "to_buy_cost": 1.25,
      "to_buy_cost_partial": false,
      "cost_note": "Cost is an estimate from typical prices, not a live price."
    },
    {
      "title": "Egg fried rice",
      "serves": 2,
      "minutes": 15,
      "ingredients": [
        {
          "name": "Eggs",
          "amount": "3",
          "from_pantry": true,
          "citations": []
        },
        {
          "name": "White rice",
          "amount": "2 cups cooked",
          "from_pantry": false,
          "citations": [
            1
          ]
        }
      ],
      "steps": [
        "Scramble the eggs and set them aside.",
        "Fry the rice, stir the eggs back in and serve."
      ],
      "notes": null,
      "to_buy": [
        {
          "slug": "rice-long-grain",
          "name": "Long Grain White Rice (2 lb)",
          "price": 1.25
        }
      ],
      "to_buy_cost": 1.25,
      "to_buy_cost_partial": false,
      "cost_note": "Cost is an estimate from typical prices, not a live price."
    },
    {
      "title": "Egg fried rice",
      "serves": 2,
      "minutes": 15,
      "ingredients": [
        {
          "name": "Eggs",
          "amount": "3",
          "from_pantry": true,
          "citations": []
        },
        {
          "name": "White rice",
          "amount": "2 cups cooked",
          "from_pantry": false,
          "citations": [
            1
          ]
        }
      ],
      "steps": [
        "Scramble the eggs and set them aside.",
        "Fry the rice, stir the eggs back in and serve."
      ],
      "notes": null,
      "to_buy": [
        {
          "slug": "rice-long-grain",
          "name": "Long Grain White Rice (2 lb)",
          "price": 1.25
        }
      ],
      "to_buy_cost": 1.25,
      "to_buy_cost_partial": false,
      "cost_note": "Cost is an estimate from typical prices, not a live price."
    },
    {
      "title": "Egg fried rice",
      "serves": 2,
      "minutes": 15,
      "ingredients": [
        {
          "name": "Eggs",
          "amount": "3",
          "from_pantry": true,
          "citations": []
        },
        {
          "name": "White rice",
          "amount": "2 cups cooked",
          "from_pantry": false,
          "citations": [
            1
          ]
        }
      ],
      "steps": [
        "Scramble the eggs and set them aside.",
        "Fry the rice, stir the eggs back in and serve."
      ],
      "notes": null,
      "to_buy": [
        {
          "slug": "rice-long-grain",
          "name": "Long Grain White Rice (2 lb)",
          "price": 1.25
        }
      ],
      "to_buy_cost": 1.25,
      "to_buy_cost_partial": false,
      "cost_note": "Cost is an estimate from typical prices, not a live price."
    }
  ]
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('food.recipe-suggestion@1', value);   // { valid, errors: [{ path, message }] }