Adding AI Insights to Data with Google Gemini

Yesterday, Elizabeth Siegle, a developer advocate for CLoudflare, showed off a really freaking cool demo making use of Cloudflare’s Workers AI support. Her demo made use of WNBA stats to create a beautiful dashboard that’s then enhanced with AI. You can find the demo here: https://wnba-analytics-ai-insights.streamlit.app/ I found this incredibly exciting. I last looked at Cloudflare’s AI stuff almost an entire year ago ("Using Cloudflare’s AI Workers to Add Translations to PDFs"), and I haven’t quite had a chance to try it again, mostly because I’ve been focused on Google Gemini for my Generative AI work. From an API/usage perspective, Cloudflare’s... more →
Posted in: JavaScript

ColdFusion Component for Google Gemini

This week I had the pleasure to present on Google Gemini at the ColdFusion Summit. If you weren’t able to make it, I do plan on giving the talk again on the ColdFusion Meetup sometime later this year. After the presentation, I took my ‘rough and ugly’ code that called Gemini and decided to wrap it up in a nice ColdFusion component. This allows for (hopefully) easier use. For example: gemini = new gemini(key="your key", model="gemini-1.5-pro");result = gemini.prompt('why is the sky blue?'); And that’s it. The result variable will contain two keys, a raw value that is exactly what Gemini returned, and a text value that narrows down into the text response. Multimodal... more →
Posted in: JavaScript

Using PDF Content with Google Gemini – An Update

Way back in March of this year, I took a look at using Google’s Gemini APIs to analyze PDF documents ("Using PDF Content with Google Gemini"). At the time, the Gemini API didn’t support PDF documents, so I made use of our (Adobe) PDF Extract service to get the text content out from the document. This "worked" but was possibly less than ideal as my "glom all the text together" approach didn’t really represent the PDF well. The PDF Extract API returns information about text context (like if it is a header for example), but my method ignored that. I’m happy to share that Gemini now supports PDF files natively. Let’s take a look at how this... more →
Posted in: JavaScript

Caching Input with Google Gemini

A little over a month ago, Google announced multiple updates to their GenAI platform. I made a note of it for research later and finally got time to look at one aspect – context caching. When you send prompts to a GenAI system, your input is tokenized for analysis. While not a "one token per word" relation, basically the bigger the input (context) the more the cost (tokens). The process of converting your input into tokens takes time, especially when dealing with large media, for example, a video. Google introduced a "Context caching" system that helps improve the performance of your queries. As the docs suggest, this is really suited for cases where you’ve got... more →
Posted in: JavaScript

Creating a Generic Generative Template Language in Google Gemini

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

Creating a Content Assistant with Gemini and GenAI

One of the use cases for generative AI that I’ve discussed before is the idea of using the tool to aid in the writing process. I’m not talking about creating content so much as creating suggestions and providing feedback about the content you yourself have created. This past weekend I worked on a "general purpose" tool with this in mind and thought I’d share it to get your feedback. ("You" being the smart readers of this blog who keep me honest when I show something stupid. 😉 The Application # The application itself is rather straightforward. It asks two questions – first, what are you trying to accomplish with your writing and what are the desired... more →
Posted in: JavaScript

Using JSON Schema with Google Gemini

Back about a month ago, I wrote up a post on how to generate JSON results using Google Gemini, "JSON Results with Google Gemini Generative AI API Calls". While you should read that post first, the process basically boiled down to: Setting the response type of the result to JSON. Without this, Gemini will return JSON but encoded in Markdown. Using a System Instruction to give directions on the "shape" of the JSON, i.e., use this key and that key. While these techniques work well, recently yet another feature was added that makes this even better, JSON schema support. JSON Schema is an abstract way to define the shape of JSON and can be really useful in validation. The website... more →
Posted in: JavaScript

Tracking Gemini Models with Pipedream

APIs, tools, consumer features, and heck, pretty much every aspect, of generative AI is changing at an incredibly rapid pace. I mostly focus on just Google Gemini and even that is pretty difficult to keep up with. Recently, Linda Lawton shared that she actually uses an automation script to keep track of the models currently available in Gemini. I thought that was a great idea and decided to see if I could build something similar using Pipedream. Here’s what I came up with. Getting Available Models via API # Normally, if I wanted to know what models I had available, I’d go to AI Studio and just look, or check the docs. While that’s fine usually, there’s actually an API... more →
Posted in: JavaScript
1 2