The Twelve (Generative) Days of Christmas – 2024 Edition / / No Comments Last year I did a fun little experiment where I asked a few different generative models to generateimages based on the classic Twelve Days of Christmas song. For those unfamiliar, the song is about a series of gifts given over twelve days: partridge in a pear treetwo turtle dovesthree French hensfour calling birdsfive golden ringssix geese a-layingseven swans a-swimmingeight maids a-milkingnine ladies dancingten lords a-leapingeleven pipers pipingtwelve drummers drumming To be clear, this was done for fun, nothing more. Also, the prompts were literally just the lyrics, nothing more (with some exceptions, see the details below). In a ‘real world’ example if you wanted to generate images... more → Posted in: JavaScript Tagged with: 2024, Christmas, Days, Edition, Generative, Twelve
Using Generative AI to Parse Web Pages into Data / / No Comments A few months back, I took a look at using JSON-LD to turn a recipe web page into pure data: Scraping Recipes Using Node.js, Pipedream, and JSON-LD. This relied on a recipe actually using JSON-LD in the header to describe itself, which is pretty common for SEO purposes. Still, I was curious as to how well generative AI could solve this problem. In theory, this could be a good ‘backup’ in cases where a site wasn’t using JSON-LD and a general exploration of ‘parsing’ a web page into data. I’ll be using Google Gemini again, but in theory, this demo would work in other services as well. Here’s what I found. Converting a Web Page into Structured Data In order... more → Posted in: JavaScript Tagged with: data, Generative, into, Pages, Parse, using
Creating a Generic Generative Template Language in Google Gemini / / No Comments I’ve been a fan of ‘random text’ for some time. "Random text" is a bit vague, but to me the idea of using code to generate random stories, or even snippets, is fascinating. Back in April, I blogged about how I created short dragon-based stories. It took a generic string: A #adjective# dragon lives #place#. She #verb# her hoard, which consists of a #number# of #thing#, #number# of #thing#, and #number# of #thing#. She feels #feeling#. And created a story by replacing the pound-wrapped tokens with real words. I used a couple of different tools to build this, but the core one was a cool little Node library named random-word-slugs. It’s a powerful random word library... more → Posted in: JavaScript Tagged with: creating, Gemini, Generative, Generic, Google, Language, Template
Upcoming Generative AI Talk by… Me! / / No Comments I don’t normally blog about upcoming conference talks, but I’m really excited to announce my first talk on generative AI, specifically Google’s Gemini will be in a few weeks at the F/ND Tech Conference. This is a free, online conference covering a wide range of topics. My talk, "Adding Generative AI to your Workflow with Google Gemini", will absolutely be appropriate for beginners (as that’s what I am) and hopefully provide a gentle introduction to working with Gen AI. Now, one point of warning – this is a Europe-based event so my talk will be… 5:45 AM on a Saturday morning, but admit it, wouldn’t you love to wake up early on a Saturday to hear... more → Posted in: JavaScript Tagged with: by..., Generative, Talk, Upcoming
Automating Movie Recommendations with Generative AI and Pipedream / / No Comments For the past few months or so, I’ve started tracking my movie watching with Letterboxd. I’m not doing a lot of reviews, mostly just logging, but I find it neat to look back and remind myself of what I’ve watched recently. You can see my profile if you’re curious, or check out my "Now" page as well. I thought it might be interesting to see if I could use my Letterboxd data along with Google Gemini as a way to suggest the next movie I should watch. I was able to build a quick workflow using the incredible Pipedream in a few minutes. Let me share with you how I did that. What does it do? # At a high level, my workflow does the following: It runs, automatically,... more → Posted in: JavaScript Tagged with: Automating, Generative, Movie, Pipedream, Recommendations
JSON Results with Google Gemini Generative AI API Calls / / No Comments Forgive the somewhat alliterative title there, but today’s post covers something that’s been on my mind since I started playing with Google Gemini, specifically, how to get the results of your API calls in JSON. To be clear, the REST API returns a result in JSON, but I’m talking about the content of the result itself. Before I continue, a quick shot out to Allen Firstenberg who has been helping me off and on with Google Gemini stuff. Anything I get wrong though is entirely my fault. 😜 Ok, so before I go on, let’s look at a typical result. Take a prompt like so: "What is the nature of light". Pass this to Gemini via the API, and the result you get, once you... more → Posted in: JavaScript Tagged with: Calls, Gemini, Generative, Google, JSON, results
Using Generative AI to Check for Spam / / No Comments A few days ago I wrote up an exploration I did in Spam APIs, "Spam APIs in 2024". After working on those demos and writing up my findings, I thought it might be interesting to see how a generative AI tool, like Googele’s Gemini would handle such a task. Initial Tests # So – once again – I’m a broken record on this – but I fired up AI Studio first to give it some quick tests. I began with this prompt: Given the following text, rate how much it appears to be spam by giving it a score between 1 and 10, with 10 being the most likely the content is spam. For my first test, I used a ‘bad’ sample (see my last post for a full listing of my sample data): 💪... more → Posted in: JavaScript Tagged with: check, Generative, spam, using
Testing Multiple Variations of Generative AI Prompts / / No Comments In nearly all of my recent explorations of Generative AI, I’ve come to realize how important prompts are. That hasn’t necessarily translated me into writing better prompts all the time, but being aware of the problem is at least one step towards correcting it, right? One of the things that I thought would help me personally would be to have a tool to quickly compare and contrast different prompts. Obviously, I could just open up multiple tabs in a browser, but I really wanted something more direct and simplified for my purposes. With that in mind, let me share what I’ve built. Prompt Tester # Prompt Tester is my incredibly imaginatively named tool to… um… test prompts.... more → Posted in: JavaScript Tagged with: Generative, multiple, Prompts, Testing, Variations