Prompt Lab · Solids

GDL + SMLib
Working...Failed
Build a

This is the free public lab: everything made here -- your prompts, the model and its code -- is public the moment it is made, in the archive for anyone to read and reuse. Nothing is sold here; a private lab of your own, where you can sell what you make, is a rung up the ladder.

the agent is working...

Build from a drawing: a PDF of up to 10 pages, an image or a text file (DXF, SVG, CSV, STEP), 2.0 MB at most.

Uploaded files

nutrients.txt (txt text, 4 KB)

Public, with the session.

Archived session bold-collet-632026-10-20 01:15 UTCbuilt on gendl: open it thereversions: 1 2 3 last

Rivets

3,833 rivets left in the community pot

A question or a problem: [email protected]; a fault in the lab's code, its issue tracker.

Download

The model's drawings and files, once it is built.

Log

stoppedThe reply hit its length limit.
promptcontinue
stoppedThe reply hit its length limit.
toolsearch_docs
tooldescribe_object
toolsearch_docs
promptlet's expand our known foods list to be a much larger database of known foodstuff, including chinese and indian, as well as fast food meals. Are there public databases of this stuff we could just link to? Or do we want to carry all the data. You decide. and can we have some lookup mechanisms for entering the daily eating diary.
doneI've built the app: you type what you ate in plain words, and it gives you a nutrition breakdown laid out like your ChatGPT example. With your example day as the input, it comes to 990 kcal, the same total as ChatGPT's. I checked that the page builds and the parser handles mixed input, but I haven't tested it in a browser. The **Open the app** link opens it. **How to use it** - **"What did you eat?"**: one food per line, or separate them with commas, semicolons, "and" or "with". Start each with an amount: "3 steamed eggs", "1 1/2 cups milk", "1½ cups milk", "half an avocado", "a slice of toast". You can also give a weight ("150 g walleye", "8oz steak", "1 lb chicken") and it is worked out from the food's weight. With no amount, it counts one serving. The results update when you click out of the box. - **"Compare with daily needs of"**: pick Woman or Man, aged 19–50 or 51–70. This sets the daily targets. **What it shows** 1. **Summary**: - Total calories, as a share of a typical day's calories for the chosen profile. - How it read each line, e.g. "1/2 cup stir-fried pumpkin → 0.5 × 1 cup Pumpkin, stir-fried". This plays the part of ChatGPT's list of assumptions. - Your strongest nutrients and the ones that need the most attention. - A warning when calories are low for a whole day. - Anything it didn't recognise, in red. These are left out of the totals. 2. **Macronutrients** for each food, with totals: calories, protein, carbs, fat and fiber. 3. **Vitamins**: A, C, D, B12 and folate. 4. **Minerals**: calcium, iron, magnesium, potassium and zinc. 5. **Comparison with daily needs**: your intake, the target, the percentage, and a rating: Good (100% or more), Slightly low (75–99%) or Low (under 75%). At the bottom is a list of every food the app knows and the serving size it counts. **How it differs from ChatGPT** - **Fixed food list:** it uses a built-in table of about 45 common foods. Each value is a standard estimate for one serving. Your 8 foods use the figures from your example, so the totals match. A food that isn't in the table is flagged rather than guessed. To add foods, add rows to the food table at the top of the source file. - **Cup, tbsp and slice aren't converted:** the amount you type just counts servings of the size shown in the list. "1 tbsp peanut butter" is right because that serving is 1 tbsp. "2 tbsp butter" is also right, since butter's serving is 1 tbsp. Only grams, ounces, pounds and kilograms are converted by weight. - **Stir-fried dishes include oil:** pumpkin and chayote include 2 tsp of oil per cup, which is 1 tsp per ½ cup as in your example. - **No follow-up questions:** it doesn't ask about your goals, as ChatGPT did at the end. The calorie figure for each profile is a rough estimate for a moderately active adult.
toolevaluate
toolcheck_app
toolwrite_model
promptcontinue, it seems you had some simple syntax errors. use paredit and similar tools to keep your parens balanced.
stoppedStopped after 12 rounds of tool calls.
toolevaluate
tool-errorwrite_model: Error compiling or loading the model file: Reader error on #<BASIC-FILE-CHARACTER-INPUT-STREAM ("/state/prompt-lab/bold-collet-63/model.lisp"/:closed #x302003FDBCBD>: Unmatched ')' near position 23219.
toolwrite_model
toolevaluate
toolread_model
tool-errorevaluate: Error: Undefined function MEAL-REPLACE-ALL-TMP called with arguments (";; Prompt lab session bold-collet-63 -- the model file. ;; Written by the modeling agent; edit it freely. The object named MODEL ;; is what (make-object 'model) builds and the viewer shows; ;; the object named APP is the web app, a GWL page the lab serves. (in-package \"PL-BOLD-COLLET-63\") ;;; Meal nutrition breakdown -- a small food database, a free-text parser ;;; and the tables of a daily nutrition report. ;; Nutrient order used in every food's :n list. (defparameter *meal-nutrients* '((\"Calories\" \"kcal\") (\"Protein\" \"g\") (\"Carbs\" \"g\") (\"Fat\" \"g\") (\"Fiber\" \"g\") (\"Vitamin A\" \"mcg\") (\"Vitamin C\" \"mg\") (\"Vitamin D\" \"mcg\") (\"Vitamin B12\" \"mcg\") (\"Folate\" \"mcg\") (\"Calcium\" \"mg\") (\"Iron\" \"mg\") (\"Magnesium\" \"mg\") (\"Potassium\" \"mg\") (\"Zinc\" \"mg\"))) ;; Each food: one natural serving. :n = cal pro carb fat fib | A C D B12 folate | Ca Fe Mg K Zn (defparameter *meal-foods* '((:name \"Pear\" :serving \"1 medium\" :grams 178 :aliases (\"pear\") :n (101 0.6 27 0.3 5.5 1 7.5 0 0 12 16 0.3 12 206 0.2)) (:name \"Apple\" :serving \"1 medium\" :grams 182 :aliases (\"apple\") :n (95 0.5 25 0.3 4.4 5 8.4 0 0 5 11 0.2 9 195 0.1)) (:name \"Banana\" :serving \"1 medium\" :grams 118 :aliases (\"banana\") :n (105 1.3 27 0.4 3.1 4 10.3 0 0 24 6 0.3 32 422 0.2)) (:name \"Orange\" :serving \"1 medium\" :grams 131 :aliases (\"orange\") :n (62 1.2 15.4 0.2 3.1 14 70 0 0 39 52 0.1 13 237 0.1)) (:name \"Orange juice\" :serving \"1 cup\" :grams 248 :aliases (\"orange juice\" \"oj\") :n (112 1.7 25.8 0.5 0.5 25 124 0 0 74 27 0.5 27 496 0.1)) (:name \"Strawberries\" :serving \"1 cup\" :grams 152 :aliases (\"strawberr\") :n (49 1 11.7 0.5 3 2 89 0 0 36 24 0.6 20 233 0.2)) (:name \"Blueberries\" :serving \"1 cup\" :grams 148 :aliases (\"blueberr\") :n (84 1.1 21 0.5 3.6 4 14 0 0 9 9 0.4 9 114 0.2)) (:name \"Grapes\" :serving \"1 cup\" :grams 151 :aliases (\"grape\") :n (104 1.1 27 0.2 1.4 5 4.8 0 0 3 15 0.5 11 288 0.1)) (:name \"Avocado\" :serving \"1 whole\" :grams 150 :aliases (\"avocado\") :n (240 3 12.8 22 10 10 15 0 0 122 18 0.8 44 728 1)) (:name \"Whole milk\" :serving \"1 cup\" :grams 244 :aliases (\"milk\" \"whole milk\") :n (149 7.7 11.7 8 0 113 0 2.9 1.13 12 276 0.07 24 322 1)) (:name \"Skim milk\" :serving \"1 cup\" :grams 245 :aliases (\"skim milk\" \"nonfat milk\" \"low-fat milk\" \"low fat milk\") :n (83 8.3 12.2 0.2 0 149 0 2.9 1.3 12 299 0.1 27 382 1)) (:name \"Plain yogurt\" :serving \"1 cup\" :grams 245 :aliases (\"yogurt\" \"yoghurt\") :n (149 8.5 11.4 8 0 66 1.2 0.1 0.9 17 296 0.1 29 380 1.4)) (:name \"Greek yogurt, nonfat\" :serving \"1 container (170 g)\" :grams 170 :aliases (\"greek yogurt\" \"greek yoghurt\") :n (100 17 6 0.7 0 2 0 0 1.3 12 187 0.1 19 240 0.9)) (:name \"Cheddar cheese\" :serving \"1 oz\" :grams 28 :aliases (\"cheese\" \"cheddar\") :n (114 7 0.4 9.4 0 75 0 0.2 0.2 5 200 0.2 8 21 1)) (:name \"Egg\" :serving \"1 large\" :grams 50 :aliases (\"egg\") :n (72 6.3 0.4 4.8 0 80 0 1.1 0.57 24 28 0.87 6 69 0.63)) (:name \"Walleye fillet, cooked\" :serving \"1 fillet (150 g)\" :grams 150 :aliases (\"walleye\") :n (180 36 0 3 0 20 0 4 3 20 25 0.8 45 585 1)) (:name \"Salmon fillet, cooked\" :serving \"1 fillet (150 g)\" :grams 150 :aliases (\"salmon\") :n (309 33 0 18.5 0 18 0 16 4.2 11 13 0.5 45 570 0.6)) (:name \"Tuna, canned in water\" :serving \"1 can (165 g)\" :grams 165 :aliases (\"tuna\") :n (191 42 0 1.4 0 28 0 2 4.9 7 18 2.5 45 393 1.2)) (:name \"Chicken breast, cooked\" :serving \"1 breast (150 g)\" :grams 150 :aliases (\"chicken\") :n (248 46.5 0 5.4 0 14 0 0.2 0.5 6 23 1.6 44 384 1.5)) (:name \"Ground beef 85%, cooked\" :serving \"100 g\" :grams 100 :aliases (\"beef\" \"ha [... 19926 more characters cut]
toolevaluate
toolevaluate
toolevaluate
tool-errorevaluate: Error: Reader error on #<BASIC-FILE-CHARACTER-INPUT-STREAM ("/state/prompt-lab/bold-collet-63/model.lisp"/:closed #x302003EB81DD>: Unmatched ')' near position 23143.
toolevaluate
tool-errorwrite_model: Error compiling or loading the model file: No such toplevel define-object keyword exists as (PL-BOLD-COLLET-63::COMPARISON-HTML (GWL:WITH-LHTML-STRING NIL (:DIV :CLASS "p-6" :STYLE "overflow-x: auto;" (:TABLE :STYLE "width: 100%; border-collapse: collapse;" (:THEAD (:TR (:TH :STYLE (THE PL-BOLD-COLLET-63::TH-LEFT) "Nutrient") (:TH :STYLE (THE PL-BOLD-COLLET-63::TH-RIGHT) "Your intake") (:TH :STYLE (THE PL-BOLD-COLLET-63::TH-RIGHT) "Daily target") (:TH :STYLE (THE PL-BOLD-COLLET-63::TH-RIGHT) "% of target") (:TH :STYLE (THE PL-BOLD-COLLET-63::TH-LEFT) "Assessment"))) (:TBODY (DOLIST (PL-BOLD-COLLET-63::C (THE PL-BOLD-COLLET-63::COMPARISONS)) (CL-WHO:HTM (:TR (:TD :STYLE (THE PL-BOLD-COLLET-63::TD-LEFT) (CL-WHO:STR (GETF PL-BOLD-COLLET-63::C :LABEL))) (:TD :STYLE (THE PL-BOLD-COLLET-63::TD-RIGHT) (CL-WHO:FMT "~a ~a" (PL-BOLD-COLLET-63::MEAL-AMOUNT-STRING (GETF PL-BOLD-COLLET-63::C :TOTAL)) (GETF PL-BOLD-COLLET-63::C :UNIT))) (:TD :STYLE (THE PL-BOLD-COLLET-63::TD-RIGHT) (CL-WHO:FMT "~a ~a" (PL-BOLD-COLLET-63::MEAL-AMOUNT-STRING (GETF PL-BOLD-COLLET-63::C :TARGET)) (GETF PL-BOLD-COLLET-63::C :UNIT))) (:TD :STYLE (THE PL-BOLD-COLLET-63::TD-RIGHT) (CL-WHO:FMT "~d%" (ROUND (GETF PL-BOLD-COLLET-63::C :PCT)))) (:TD :STYLE (CONCATENATE 'STRING (THE PL-BOLD-COLLET-63::TD-LEFT) (CASE (GETF PL-BOLD-COLLET-63::C :RATING) (:GOOD " color: #15803d;") (:SLIGHTLY-LOW " color: #b45309;") (T " color: #b91c1c;"))) (CL-WHO:STR (CASE (GETF PL-BOLD-COLLET-63::C :RATING) (:GOOD "Good") (:SLIGHTLY-LOW "Slightly low") (T "Low")))))))))))).
toolwrite_model
tooldescribe_object
toolsearch_docs
toolread_file
promptan app where i can tell it what I ate, and it gives me a nutrition breakdown. I'm uploading an example of output directly from a ChatGPT session, but we'd like to approximate something like this in a discrete Gendl/GWL app.
noteThis session now builds a web app.
noteUploaded nutrients.txt (txt text, 4 KB). The visitor declared the right to use and share it; it is public with the session. It goes to the agent with the next prompt.
noteSession bold-collet-63 opened. Describe what to build.
viewport 1
View
Perspective
Graphics format
Hidden lines

Wireframe · trimetric

Welcome to Sluice.

Sluice is for inspecting Gendl models while you're developing them. You can see your model structure in the tree at the upper left.

The display list of this viewport is empty. Click a node in the tree to apply the add-leaves operation.

The rendering mode is Wireframe (this viewport's View menu). Wireframe is a pannable, zoomable SVG; the shaded modes are navigable X3D scenes, in either of two X3D browsers. The X_ITE scene offers a headset button where WebXR is available.

Your web app

It shows here, live, once the agent has built it. Describe it on the left and press Build.

Model file