Add the structured-output-pizza demo
One JSON agent declared with Go types (Gemma 4 E4B on llmman), listed in the README's demo table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d86eca0 parent: 335ef35 modified
README.md +1 -0 | @@ -129,6 +129,7 @@ The `demos/` directory holds ready-made set-ups (most with a README explaining h | ||
| 129 | 129 | | `demos/llmman/` | mm on llmman, and an agent that asks other agents | |
| 130 | 130 | | `demos/ollama/` | mm on Ollama | |
| 131 | 131 | | `demos/structured-output/` | agents that answer in JSON, and a coordinator using them | |
| 132 | +| `demos/structured-output-pizza/` | one JSON agent declared with Go types: a pizza's name → its ingredients (quantity, unit, category, allergens), whether it is vegetarian, its baking time (Gemma 4 E4B on llmman) | | |
| 132 | 133 | | `demos/agents-md-file/` | an agent following a project's `AGENTS.md` | |
| 133 | 134 | | `demos/mini-mes/` | small teams of agents (`riker` coordinating a specifier and a coder, `gopher` a Go specialist) | |
| 134 | 135 | | `demos/little-coder/` | a Go + htmx web-app generator for a small local model (Mellum2 12B on llmman, 32 GB RAM): a tested starter, skills, `AGENTS.md`, measured results | |
| @@ -129,6 +129,7 @@ The `demos/` directory holds ready-made set-ups (most with a README explaining h | |||
| 129 | | `demos/llmman/` | mm on llmman, and an agent that asks other agents | | 129 | | `demos/llmman/` | mm on llmman, and an agent that asks other agents | |
| 130 | | `demos/ollama/` | mm on Ollama | | 130 | | `demos/ollama/` | mm on Ollama | |
| 131 | | `demos/structured-output/` | agents that answer in JSON, and a coordinator using them | | 131 | | `demos/structured-output/` | agents that answer in JSON, and a coordinator using them | |
| 132 | +| `demos/structured-output-pizza/` | one JSON agent declared with Go types: a pizza's name → its ingredients (quantity, unit, category, allergens), whether it is vegetarian, its baking time (Gemma 4 E4B on llmman) | | ||
| 132 | | `demos/agents-md-file/` | an agent following a project's `AGENTS.md` | | 133 | | `demos/agents-md-file/` | an agent following a project's `AGENTS.md` | |
| 133 | | `demos/mini-mes/` | small teams of agents (`riker` coordinating a specifier and a coder, `gopher` a Go specialist) | | 134 | | `demos/mini-mes/` | small teams of agents (`riker` coordinating a specifier and a coder, `gopher` a Go specialist) | |
| 134 | | `demos/little-coder/` | a Go + htmx web-app generator for a small local model (Mellum2 12B on llmman, 32 GB RAM): a tested starter, skills, `AGENTS.md`, measured results | | 135 | | `demos/little-coder/` | a Go + htmx web-app generator for a small local model (Mellum2 12B on llmman, 32 GB RAM): a tested starter, skills, `AGENTS.md`, measured results | |
added
demos/structured-output-pizza/README.en.md +63 -0 | new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +# JSON answers from Go types — a pizza's ingredients | |
| 2 | + | |
| 3 | +*[Version française](README.fr.md)* | |
| 4 | + | |
| 5 | +One agent that answers **only in JSON**: name a pizza, get its ingredients for one 30 cm pizza. The shape of the answer is declared as Go types under `structuredOutput` in `agent.yaml`. | |
| 6 | + | |
| 7 | +Model: **Gemma 4 E4B** (`hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M`) on **llmman**. | |
| 8 | + | |
| 9 | +## Run | |
| 10 | + | |
| 11 | +```bash | |
| 12 | +llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | |
| 13 | +cd demos/structured-output-pizza | |
| 14 | +mm -p "A four-cheese pizza" | jq . | |
| 15 | +``` | |
| 16 | + | |
| 17 | +In prompt mode (`-p`), stdout holds the JSON alone, so it pipes into `jq`. | |
| 18 | + | |
| 19 | +## The declaration | |
| 20 | + | |
| 21 | +```go | |
| 22 | +// One ingredient of the pizza. | |
| 23 | +type Ingredient struct { | |
| 24 | + Name string `json:"name"` // the ingredient's name, in the user's language | |
| 25 | + Quantity float64 `json:"quantity"` // amount for one pizza | |
| 26 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | |
| 27 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | |
| 28 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | |
| 29 | + Optional bool `json:"optional"` | |
| 30 | +} | |
| 31 | + | |
| 32 | +type Pizza struct { | |
| 33 | + Name string `json:"name"` | |
| 34 | + Vegetarian bool `json:"vegetarian"` | |
| 35 | + Ingredients []Ingredient `json:"ingredients"` | |
| 36 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | |
| 37 | +} | |
| 38 | + | |
| 39 | +var Recipe Pizza | |
| 40 | +``` | |
| 41 | + | |
| 42 | +- The `var` names the root of the answer: here one `Pizza` object. `var Recipes = []Pizza{}` would ask for an array. | |
| 43 | +- The `//` comments become the fields' `description` in the JSON Schema; they are where the allowed values go, since `const` (and so enums) is refused. | |
| 44 | +- Every key is required; a pointer (`*int`) also allows `null`. | |
| 45 | +- An agent with `structuredOutput` declares no tool: `bashTool`, `editTools`, `planTool`, `fetchContentTool`, `askUserTool` are `false` and `skillsDir` is `no-skills`. | |
| 46 | + | |
| 47 | +## Seen on 2026-10-16 | |
| 48 | + | |
| 49 | +`mm -p "A four-cheese pizza"` (about 40 s): | |
| 50 | + | |
| 51 | +``` | |
| 52 | +Four-Cheese Pizza — vegetarian: true — bakingTime: 12 | |
| 53 | +Pizza Dough 300 g (base), Tomato Sauce 50 g (sauce), Mozzarella 100 g, Gorgonzola 50 g, | |
| 54 | +Provolone 50 g, Parmesan 20 g (cheese), Olive Oil 15 ml (other) | |
| 55 | +``` | |
| 56 | + | |
| 57 | +`mm -p "Une pizza margherita"`: five ingredients, names in Italian (`Mozzarella di bufala`, `Basilico fresco`…) — the model chose the dish's own language over the question's. | |
| 58 | + | |
| 59 | +## Further reading | |
| 60 | + | |
| 61 | +- Every Go construct and its JSON Schema: [configuration reference — `structuredOutput`](../../docs/en/reference/configuration.md#structuredoutput) | |
| 62 | +- Step by step: [Get answers as JSON](../../docs/en/how-to/get-json-answers.md) | |
| 63 | +- Several JSON agents and a coordinator: `demos/structured-output/` | |
| new file mode 100644 | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | +# JSON answers from Go types — a pizza's ingredients | ||
| 2 | + | ||
| 3 | +*[Version française](README.fr.md)* | ||
| 4 | + | ||
| 5 | +One agent that answers **only in JSON**: name a pizza, get its ingredients for one 30 cm pizza. The shape of the answer is declared as Go types under `structuredOutput` in `agent.yaml`. | ||
| 6 | + | ||
| 7 | +Model: **Gemma 4 E4B** (`hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M`) on **llmman**. | ||
| 8 | + | ||
| 9 | +## Run | ||
| 10 | + | ||
| 11 | +```bash | ||
| 12 | +llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | ||
| 13 | +cd demos/structured-output-pizza | ||
| 14 | +mm -p "A four-cheese pizza" | jq . | ||
| 15 | +``` | ||
| 16 | + | ||
| 17 | +In prompt mode (`-p`), stdout holds the JSON alone, so it pipes into `jq`. | ||
| 18 | + | ||
| 19 | +## The declaration | ||
| 20 | + | ||
| 21 | +```go | ||
| 22 | +// One ingredient of the pizza. | ||
| 23 | +type Ingredient struct { | ||
| 24 | + Name string `json:"name"` // the ingredient's name, in the user's language | ||
| 25 | + Quantity float64 `json:"quantity"` // amount for one pizza | ||
| 26 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | ||
| 27 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | ||
| 28 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | ||
| 29 | + Optional bool `json:"optional"` | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +type Pizza struct { | ||
| 33 | + Name string `json:"name"` | ||
| 34 | + Vegetarian bool `json:"vegetarian"` | ||
| 35 | + Ingredients []Ingredient `json:"ingredients"` | ||
| 36 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +var Recipe Pizza | ||
| 40 | +``` | ||
| 41 | + | ||
| 42 | +- The `var` names the root of the answer: here one `Pizza` object. `var Recipes = []Pizza{}` would ask for an array. | ||
| 43 | +- The `//` comments become the fields' `description` in the JSON Schema; they are where the allowed values go, since `const` (and so enums) is refused. | ||
| 44 | +- Every key is required; a pointer (`*int`) also allows `null`. | ||
| 45 | +- An agent with `structuredOutput` declares no tool: `bashTool`, `editTools`, `planTool`, `fetchContentTool`, `askUserTool` are `false` and `skillsDir` is `no-skills`. | ||
| 46 | + | ||
| 47 | +## Seen on 2026-10-16 | ||
| 48 | + | ||
| 49 | +`mm -p "A four-cheese pizza"` (about 40 s): | ||
| 50 | + | ||
| 51 | +``` | ||
| 52 | +Four-Cheese Pizza — vegetarian: true — bakingTime: 12 | ||
| 53 | +Pizza Dough 300 g (base), Tomato Sauce 50 g (sauce), Mozzarella 100 g, Gorgonzola 50 g, | ||
| 54 | +Provolone 50 g, Parmesan 20 g (cheese), Olive Oil 15 ml (other) | ||
| 55 | +``` | ||
| 56 | + | ||
| 57 | +`mm -p "Une pizza margherita"`: five ingredients, names in Italian (`Mozzarella di bufala`, `Basilico fresco`…) — the model chose the dish's own language over the question's. | ||
| 58 | + | ||
| 59 | +## Further reading | ||
| 60 | + | ||
| 61 | +- Every Go construct and its JSON Schema: [configuration reference — `structuredOutput`](../../docs/en/reference/configuration.md#structuredoutput) | ||
| 62 | +- Step by step: [Get answers as JSON](../../docs/en/how-to/get-json-answers.md) | ||
| 63 | +- Several JSON agents and a coordinator: `demos/structured-output/` | ||
added
demos/structured-output-pizza/README.fr.md +57 -0 | new file mode 100644 | ||
| @@ -0,0 +1,57 @@ | ||
| 1 | +# Des réponses JSON à partir de types Go — les ingrédients d'une pizza | |
| 2 | + | |
| 3 | +*[English version](README.en.md)* | |
| 4 | + | |
| 5 | +Un agent qui répond **uniquement en JSON** : nommez une pizza, recevez ses ingrédients pour une pizza de 30 cm. La forme de la réponse est déclarée en types Go sous `structuredOutput` dans `agent.yaml`. | |
| 6 | + | |
| 7 | +Modèle : **Gemma 4 E4B** (`hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M`) sur **llmman**. | |
| 8 | + | |
| 9 | +## Lancer | |
| 10 | + | |
| 11 | +```bash | |
| 12 | +llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | |
| 13 | +cd demos/structured-output-pizza | |
| 14 | +mm -p "Une pizza quatre fromages" | jq . | |
| 15 | +``` | |
| 16 | + | |
| 17 | +En mode prompt (`-p`), stdout ne contient que le JSON : on peut le passer à `jq`. | |
| 18 | + | |
| 19 | +## La déclaration | |
| 20 | + | |
| 21 | +```go | |
| 22 | +// One ingredient of the pizza. | |
| 23 | +type Ingredient struct { | |
| 24 | + Name string `json:"name"` // the ingredient's name, in the user's language | |
| 25 | + Quantity float64 `json:"quantity"` // amount for one pizza | |
| 26 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | |
| 27 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | |
| 28 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | |
| 29 | + Optional bool `json:"optional"` | |
| 30 | +} | |
| 31 | + | |
| 32 | +type Pizza struct { | |
| 33 | + Name string `json:"name"` | |
| 34 | + Vegetarian bool `json:"vegetarian"` | |
| 35 | + Ingredients []Ingredient `json:"ingredients"` | |
| 36 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | |
| 37 | +} | |
| 38 | + | |
| 39 | +var Recipe Pizza | |
| 40 | +``` | |
| 41 | + | |
| 42 | +- Le `var` désigne la racine de la réponse : ici un objet `Pizza`. `var Recipes = []Pizza{}` demanderait un tableau. | |
| 43 | +- Les commentaires `//` deviennent la `description` des champs dans le JSON Schema ; c'est là qu'on liste les valeurs permises, puisque `const` (et donc les énumérations) est refusé. | |
| 44 | +- Toutes les clés sont obligatoires ; un pointeur (`*int`) autorise en plus `null`. | |
| 45 | +- Un agent avec `structuredOutput` ne déclare aucun outil : `bashTool`, `editTools`, `planTool`, `fetchContentTool`, `askUserTool` valent `false` et `skillsDir` vaut `no-skills`. | |
| 46 | + | |
| 47 | +## Observé le 2026-10-16 | |
| 48 | + | |
| 49 | +`mm -p "Une pizza quatre fromages"` (environ 40 s) : `"name": "Quatre Fromages"`, `"vegetarian": true`, une pâte, une sauce, quatre fromages (dont `{"name":"Brie","quantity":50.0,"unit":"g","category":"cheese","allergens":["lactose"],"optional":false}`) et du thym facultatif (`"unit":"pinch"`, `"optional":true`). | |
| 50 | + | |
| 51 | +`mm -p "Une pizza margherita"` : cinq ingrédients et `"bakingTime": 12`, avec des noms en italien (`Mozzarella di bufala`, `Basilico fresco`…) — le modèle a préféré la langue du plat à celle de la question. | |
| 52 | + | |
| 53 | +## Pour aller plus loin | |
| 54 | + | |
| 55 | +- Chaque construction Go et son JSON Schema : [référence de configuration — `structuredOutput`](../../docs/fr/reference/configuration.md#structuredoutput) | |
| 56 | +- Pas à pas : [Obtenir des réponses en JSON](../../docs/fr/how-to/get-json-answers.md) | |
| 57 | +- Plusieurs agents JSON et un coordinateur : `demos/structured-output/` | |
| new file mode 100644 | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | +# Des réponses JSON à partir de types Go — les ingrédients d'une pizza | ||
| 2 | + | ||
| 3 | +*[English version](README.en.md)* | ||
| 4 | + | ||
| 5 | +Un agent qui répond **uniquement en JSON** : nommez une pizza, recevez ses ingrédients pour une pizza de 30 cm. La forme de la réponse est déclarée en types Go sous `structuredOutput` dans `agent.yaml`. | ||
| 6 | + | ||
| 7 | +Modèle : **Gemma 4 E4B** (`hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M`) sur **llmman**. | ||
| 8 | + | ||
| 9 | +## Lancer | ||
| 10 | + | ||
| 11 | +```bash | ||
| 12 | +llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | ||
| 13 | +cd demos/structured-output-pizza | ||
| 14 | +mm -p "Une pizza quatre fromages" | jq . | ||
| 15 | +``` | ||
| 16 | + | ||
| 17 | +En mode prompt (`-p`), stdout ne contient que le JSON : on peut le passer à `jq`. | ||
| 18 | + | ||
| 19 | +## La déclaration | ||
| 20 | + | ||
| 21 | +```go | ||
| 22 | +// One ingredient of the pizza. | ||
| 23 | +type Ingredient struct { | ||
| 24 | + Name string `json:"name"` // the ingredient's name, in the user's language | ||
| 25 | + Quantity float64 `json:"quantity"` // amount for one pizza | ||
| 26 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | ||
| 27 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | ||
| 28 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | ||
| 29 | + Optional bool `json:"optional"` | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +type Pizza struct { | ||
| 33 | + Name string `json:"name"` | ||
| 34 | + Vegetarian bool `json:"vegetarian"` | ||
| 35 | + Ingredients []Ingredient `json:"ingredients"` | ||
| 36 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +var Recipe Pizza | ||
| 40 | +``` | ||
| 41 | + | ||
| 42 | +- Le `var` désigne la racine de la réponse : ici un objet `Pizza`. `var Recipes = []Pizza{}` demanderait un tableau. | ||
| 43 | +- Les commentaires `//` deviennent la `description` des champs dans le JSON Schema ; c'est là qu'on liste les valeurs permises, puisque `const` (et donc les énumérations) est refusé. | ||
| 44 | +- Toutes les clés sont obligatoires ; un pointeur (`*int`) autorise en plus `null`. | ||
| 45 | +- Un agent avec `structuredOutput` ne déclare aucun outil : `bashTool`, `editTools`, `planTool`, `fetchContentTool`, `askUserTool` valent `false` et `skillsDir` vaut `no-skills`. | ||
| 46 | + | ||
| 47 | +## Observé le 2026-10-16 | ||
| 48 | + | ||
| 49 | +`mm -p "Une pizza quatre fromages"` (environ 40 s) : `"name": "Quatre Fromages"`, `"vegetarian": true`, une pâte, une sauce, quatre fromages (dont `{"name":"Brie","quantity":50.0,"unit":"g","category":"cheese","allergens":["lactose"],"optional":false}`) et du thym facultatif (`"unit":"pinch"`, `"optional":true`). | ||
| 50 | + | ||
| 51 | +`mm -p "Une pizza margherita"` : cinq ingrédients et `"bakingTime": 12`, avec des noms en italien (`Mozzarella di bufala`, `Basilico fresco`…) — le modèle a préféré la langue du plat à celle de la question. | ||
| 52 | + | ||
| 53 | +## Pour aller plus loin | ||
| 54 | + | ||
| 55 | +- Chaque construction Go et son JSON Schema : [référence de configuration — `structuredOutput`](../../docs/fr/reference/configuration.md#structuredoutput) | ||
| 56 | +- Pas à pas : [Obtenir des réponses en JSON](../../docs/fr/how-to/get-json-answers.md) | ||
| 57 | +- Plusieurs agents JSON et un coordinateur : `demos/structured-output/` | ||
added
demos/structured-output-pizza/agent.yaml +43 -0 | new file mode 100644 | ||
| @@ -0,0 +1,43 @@ | ||
| 1 | +# Agent settings — "pizza": an agent that answers ONLY in JSON — the | |
| 2 | +# ingredients of the pizza you name, for one 30 cm pizza — with the shape | |
| 3 | +# declared below in `structuredOutput`. mini-me on Gemma 4 E4B, served by | |
| 4 | +# llmman (https://github.com/llmmanorg/llmman). | |
| 5 | +# | |
| 6 | +# llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | |
| 7 | +# cd demos/structured-output-pizza | |
| 8 | +# mm -p "Une pizza quatre fromages" | jq . | |
| 9 | +provider: llmman | |
| 10 | +model: hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | |
| 11 | +baseUrl: http://127.0.0.1:17434/v1 | |
| 12 | +fallback: http://host.docker.internal:17434/v1 | |
| 13 | + | |
| 14 | +bashTool: false | |
| 15 | +editTools: false | |
| 16 | +planTool: false | |
| 17 | +fetchContentTool: false | |
| 18 | +askUserTool: false | |
| 19 | +skillsDir: no-skills | |
| 20 | + | |
| 21 | +system: | | |
| 22 | + You are a pizzaiolo. For the pizza the user names, list its ingredients | |
| 23 | + for one 30 cm pizza. | |
| 24 | + | |
| 25 | +structuredOutput: | | |
| 26 | + // One ingredient of the pizza. | |
| 27 | + type Ingredient struct { | |
| 28 | + Name string `json:"name"` // the ingredient's name, in the user's language | |
| 29 | + Quantity float64 `json:"quantity"` // amount for one pizza | |
| 30 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | |
| 31 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | |
| 32 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | |
| 33 | + Optional bool `json:"optional"` | |
| 34 | + } | |
| 35 | + | |
| 36 | + type Pizza struct { | |
| 37 | + Name string `json:"name"` | |
| 38 | + Vegetarian bool `json:"vegetarian"` | |
| 39 | + Ingredients []Ingredient `json:"ingredients"` | |
| 40 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | |
| 41 | + } | |
| 42 | + | |
| 43 | + var Recipe Pizza | |
| new file mode 100644 | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | +# Agent settings — "pizza": an agent that answers ONLY in JSON — the | ||
| 2 | +# ingredients of the pizza you name, for one 30 cm pizza — with the shape | ||
| 3 | +# declared below in `structuredOutput`. mini-me on Gemma 4 E4B, served by | ||
| 4 | +# llmman (https://github.com/llmmanorg/llmman). | ||
| 5 | +# | ||
| 6 | +# llmman pull hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | ||
| 7 | +# cd demos/structured-output-pizza | ||
| 8 | +# mm -p "Une pizza quatre fromages" | jq . | ||
| 9 | +provider: llmman | ||
| 10 | +model: hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M | ||
| 11 | +baseUrl: http://127.0.0.1:17434/v1 | ||
| 12 | +fallback: http://host.docker.internal:17434/v1 | ||
| 13 | + | ||
| 14 | +bashTool: false | ||
| 15 | +editTools: false | ||
| 16 | +planTool: false | ||
| 17 | +fetchContentTool: false | ||
| 18 | +askUserTool: false | ||
| 19 | +skillsDir: no-skills | ||
| 20 | + | ||
| 21 | +system: | | ||
| 22 | + You are a pizzaiolo. For the pizza the user names, list its ingredients | ||
| 23 | + for one 30 cm pizza. | ||
| 24 | + | ||
| 25 | +structuredOutput: | | ||
| 26 | + // One ingredient of the pizza. | ||
| 27 | + type Ingredient struct { | ||
| 28 | + Name string `json:"name"` // the ingredient's name, in the user's language | ||
| 29 | + Quantity float64 `json:"quantity"` // amount for one pizza | ||
| 30 | + Unit string `json:"unit"` // "g", "ml", "piece", "pinch" or "to taste" | ||
| 31 | + Category string `json:"category"` // "base", "sauce", "cheese", "meat", "vegetable", "herb" or "other" | ||
| 32 | + Allergens []string `json:"allergens"` // e.g. "gluten", "lactose"; empty when none | ||
| 33 | + Optional bool `json:"optional"` | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + type Pizza struct { | ||
| 37 | + Name string `json:"name"` | ||
| 38 | + Vegetarian bool `json:"vegetarian"` | ||
| 39 | + Ingredients []Ingredient `json:"ingredients"` | ||
| 40 | + BakingTime *int `json:"bakingTime"` // minutes, null when unknown | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + var Recipe Pizza | ||