Interrogate Your PDFs with Chrome AI / / No Comments Yesterday I blogged about using PDF.js and Chrome’s on-device AI to create summaries of PDF documents, all within the browser, for free. In that post I mentioned it would be possible to build a Q and A system so users could ask questions about the document, and like a dog with a bone, I couldn’t let it go. Last I built not one, but two demos of this. Check it out. Version One Before I begin, note that this version makes use of the Prompt API, which is still behind a flag in Chrome. For this demo to work for you, you would need the latest Chrome and the right flags enabled. The Prompt API is available in extensions without the flag and it wouldn’t surprise me if this requirement... more → Posted in: JavaScript Tagged with: Chrome, Interrogate, PDFs
Using Chrome AI to Rewrite Monstrous JSON / / No Comments Happy Saturday folks, and while this is a topic I’ve covered many times here, I was bored and wanting to write some code, so I whipped up a quick demo. One of my favorite uses of AI is to take abstract data and write a human readable form of it. Now to be clear, this is not something you need AI for. Given that you know the shape of your data, you can create your own summary using hard-coded rules about what values to show, how to present them, and so forth. What I like about the Gen AI use-case for this is the amount of randomness and creativity you get in the responses. In the past I’ve done this with weather forecasts and chart data, but today I thought I’d try something... more → Posted in: JavaScript Tagged with: Chrome, JSON, Monstrous, Rewrite, using
Using Chrome AI for Color Suggestions / / No Comments Today’s blog post came to me on the way to dropping of my kids at school and made complete sense to me, but I’ve also got the flu and am heavily medicated, so take that for what you will. The idea was simple, given a description of something in the real world, could I use AI to generate RGB colors that would represent that abstract idea. I thought this could be a good use of Chrome’s built-in AI model and decided to whip up a quick demo. The front end is pretty simple, just a form for you to enter your description and a place for the results: <h2>Description to Color</h2> <p> In the form field below, describe the color you are trying to recreate and Chrome... more → Posted in: JavaScript Tagged with: Chrome, Color, Suggestions, using
Generating Relevant Random JSON with Chrome AI / / No Comments A few weeks ago I blogged a demo where I used Chrome’s on-device AI feature to parse a "generic template language" and return random strings. If you’re so inclined (and of course you are), you can read that post here: "Creating a Generic Generative Language with Chrome AI". The idea was to give the AI model a template string that described what was random, and how it was random (this is a name, this is a number, this is a color, etc) and have the model fill in the blanks with appropriate values. At work, I’ve been digging into our platform and trying to learn as much as possible. One of the cooler features of Webflow is the CMS. You define a collection (type... more → Posted in: JavaScript Tagged with: Chrome, Generating, JSON, Random, Relevant
Checking for Spam Content with Chrome AI / / No Comments Earlier this week I mentioned I’m looking at my previous server-based generative AI demos and seeing which could possibly make sense using on-device AI with Chrome’s AI support. I remembered a demo from last year where I tested spam detection using Google Gemini. That demo had worked out rather well and so I thought I’d try it out in Chrome. Ok, but why? Spam detection is important, and a server-based solution could have many users, especially in sites that make use of a lot of user generated content. But what would be the point doing this in the browser? Consider the fact that many of the Chrome AI APIs help with writing, I think such a solution could be useful in helping flag... more → Posted in: JavaScript Tagged with: Checking, Chrome, Content, spam
Creating a Generic Generative Language with Chrome AI / / No Comments As I explore Chrome’s on-device AI initiatives, one of the things I’m doing is looking at some of my older demos (kinda funny to think of ‘old’ GenAI demos) and seeing which may make sense in the browser versus API calls. Last July, I investigated creating a template language parser with Google Gemini. The idea was – take a string with tokens that defined a type of word and have Gemini replace it. So for example: My name is {{ name }} and my favorite food is {{ food }}. I asked Gemini to look for values inside brackets, use that as the seed of a random word, and replace it. So for example: My name is Frederic Dinglehooper the 3rd and my favorite food is sushi. I... more → Posted in: JavaScript Tagged with: Chrome, creating, Generative, Generic, Language
Adding Generative Summaries with Chrome AI / / No Comments Earlier this year (sigh, when I had a job), I built a demo using Chrome’s built-in AI support to do something I thought was really interesting – progressively enhance product reviews to make it easier to see which were trending negative versus positive. It was a great example (imo!) of how AI support could enhance the experience in supported browsers without impacting the experience for others. That demo was on my mind this week, and it occurred to me that it would also be a great place to add summarization. The Summarizer API is now fully released, for Chrome that is, and does not need a flag enabled or anything like that. I’ve blogged about this API a few times already, most... more → Posted in: JavaScript Tagged with: Adding, Chrome, Generative, Summaries
Using Chrome AI to Summarize Comic Books / / No Comments A few weeks back, I blogged about analyzing comic books with gen ai, and honestly, it worked really darn well. I extracted the pages with Python, and send them to Google Gemini to create the summary. I was naturally curious to see if this could be done entirely on device, using Chrome’s AI support. Here’s what I found. First, a reminder – a few days ago I updated my web-based comic book reader and described that process. The code I’m sharing today is built upon that first application, so if you missed that post, I’d strongly suggest reading it first. (And if you don’t want to miss any of my posts, don’t forget to subscribe!). How It Works Alright –... more → Posted in: JavaScript Tagged with: Books, Chrome, Comic, Summarize, using