From d949c229cb3ed8710542b6c5d9107270cac9f035 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Tue, 30 Apr 2024 12:00:20 +0100 Subject: [PATCH] Gemini: Allow details tags --- content/curiosities.md | 2 +- content/posts/chef-gpt/index.md | 15 +++++---------- layouts/shortcodes/details.gmi | 2 ++ 3 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 layouts/shortcodes/details.gmi diff --git a/content/curiosities.md b/content/curiosities.md index f678890a..2f885fc3 100644 --- a/content/curiosities.md +++ b/content/curiosities.md @@ -27,7 +27,7 @@ I'm getting older, and sites I've been creative on are dying or becoming marketi ## Art and Creativity -* As I travel I like to take 30 second video clips of the peaceful places. I visit the 🧘‍♂️ [site I made for them](https://30s.byjp.me/) when I want to relax for a moment. +* As I travel I like to take 30 second video clips of the peaceful places. I visit the 🧘 [site I made for them](https://30s.byjp.me/) when I want to relax for a moment. * My friend created a beautiful alphabet, I turned it into a font and 👨‍🎤 [performance microsite](https://caspian.byjp.me). Read or listen to 📖 [the story right here](/posts/the-beauty-of-type). * I once studied biomedical physics, so when I had an MRI of my head I jumped at the opportunity to extract a 3D model of my brain and 🧠 [render it in WebGL online](https://brain.byjp.me/). * I built a clockface that counts 🕰 [the seconds since I was born](https://tictoc.byjp.me/). In binary. diff --git a/content/posts/chef-gpt/index.md b/content/posts/chef-gpt/index.md index 5f5d4ba1..001a6b30 100644 --- a/content/posts/chef-gpt/index.md +++ b/content/posts/chef-gpt/index.md @@ -36,9 +36,7 @@ So, with that in mind and my rapidly wilting vegetables in hand, I decided to as I wrote a prompt (and re-wrote it a few times, fiddling with the output) so that I'd end up with a recipe I could use in my favourite recipe app, [Mela](https://mela.recipes). In my prompt I included my general request (including my Zoe-taught guidelines), the full list of ingredients I had to hand, and some details of [Mela's (awesome) file format](https://mela.recipes/fileformat/index.html), so it'd be easy to import and use. -
-If you like reading prompts meant for LLMs you can peek in here. - +{{% details "If you like reading prompts meant for LLMs you can peek in here." %}} > Give me a tasty recipe, that keeps glucose levels low, which I can make with any of the following ingredients I have available: > > Smoked salmon\ @@ -58,8 +56,7 @@ I wrote a prompt (and re-wrote it a few times, fiddling with the output) so that > Tomatoes > > Give your answer in JSON format with the keys: `id` (a UUID), `title`, `text` (the description of the recipe), `images` (an empty array), `categories` (an empty array), `yield` (the yield as a string, eg. "4 people"), `prepTime` (the prep time, in the format 3h 30m), `cookTime` (the time to cook, in the format 3h 30m), `totalTime` (the total time to cook, in the format 3h 30m), `ingredients` (a list of ingredients, in metric measurements, separated with `\n`), `instructions`(one paragraph per step, separated by `\n\n`. It's very important you don't use numbers), `notes` (written in markdown, containing any other notes if any are needed), and `nutrition` (an empty string). - -
+{{%/ details %}} ## Importing into Mela @@ -67,8 +64,7 @@ ChatGPT _is_ impressive, in that it did produce a recipe for "Smoked Salmon and {{< figure src="recipe.webp" title="Mela's gorgeous user interface, inviting me to start a-cookin'. If you'd like to try the same recipe (🫣) then you can use the mela recipe data below, or [grab the PDF](recipe.pdf)." alt="A simple and elegant screenshot of the Mela recipe app showing the recipe generated by ChatGPT. You can read the recipe in the PDF linked to in this image's caption.">}} -
-If you're the kind of person who likes reading JSON recipe files (hi friend!), then get a load of this! +{{% details "If you're the kind of person who likes reading JSON recipe files (hi friend!), then get a load of this!" %}} ```json { @@ -86,10 +82,9 @@ ChatGPT _is_ impressive, in that it did produce a recipe for "Smoked Salmon and "notes": "* Feel free to adjust the vegetables based on personal preference or availability.\n* This recipe is versatile - you can add additional herbs or spices for extra flavor.\n* Ensure to check the label when purchasing smoked salmon to ensure it doesn't contain added sugars or sauces.", "nutrition": "" } - ``` -
+{{% /details %}} So, the fact that it looks so good is _definitely_ Mela's fault (did I mention how much I like that app?), but nothing here looked like it'd kill me so I dug out my large skillet and got to work. @@ -97,7 +92,7 @@ So, the fact that it looks so good is _definitely_ Mela's fault (did I mention h As I followed the recipe (I made sure not to read ahead too closely, to keep the sense of suspense alive) I began to realise ~~ChefGPT's first mistake~~ why a statistical word-picker won't be making your most loved recipes any time soon. It turns out my prompt "with any of the following ingredients I have available" ended up being interpreted more like "using exactly all of these ingredients". -So I got a _Smoked salmon, Gnocchi, Broccoli, Brussel Sprout, Onion, Sweet Potato, Mushroom, and Butter bean_ stir fry with _Almonds, Sunflower seeds, Hazelnuts, Sweetcorn, Chickpeas, Tuna, and Tomatoes_ on top. 🤷‍♂️ +So I got a _Smoked salmon, Gnocchi, Broccoli, Brussel Sprout, Onion, Sweet Potato, Mushroom, and Butter bean_ stir fry with _Almonds, Sunflower seeds, Hazelnuts, Sweetcorn, Chickpeas, Tuna, and Tomatoes_ on top. 🤷 I kept going. For science. diff --git a/layouts/shortcodes/details.gmi b/layouts/shortcodes/details.gmi new file mode 100644 index 00000000..68f89dbc --- /dev/null +++ b/layouts/shortcodes/details.gmi @@ -0,0 +1,2 @@ +{{ (.Get 0) | markdownify }} +{{ trim (partial "markdown.gmi" .Inner) "\n\r" -}}