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
Adding Programming Language Detection with Built-in Chrome AI / / No Comments As I’ve been playing, and thinking, more and more about how to best add Chrome AI support to web apps, I came across an interesting use-case that I think could be helpful, and like in my previous examples, be completely ok if it didn’t actually work. When I write on the developer blog at Foxit, I make use of WordPress plugin for code samples. This editor has a place for you to both paste in your code, and select the language so the proper highlighter is used: This works well enough, but it gets a bit annoying to have to constantly keep selecting Python in the dropdown. Ideally the form would use the last language (simple enough via LocalStorage), but I was curious how well Chrome’s... more → Posted in: JavaScript Tagged with: Adding, Builtin, Chrome, Detection, Language, programming
Using Chrome AI for Sentiment Analysis (Again) / / No Comments Every now and then I get an idea for a blog post/demo, prepare to write about it, and realize I’ve actually covered the topic in the past. Sometimes, though, it works out really well especially when the technology has changed quite a bit. Almost a year ago, I blogged about doing sentiment analysis with Chrome’s AI upcoming AI feature. At the time, it worked…. ok. The biggest issue at the time was the inability to provide a system instruction to the model as well as being able to shape the response a particular way. Thankfully, both of those are now supported. As a reminder, the prompt API for the web is still in an origin trial, see the docs for more information and join the... more → Posted in: JavaScript Tagged with: Again, Analysis, Chrome, Sentiment, using
Progressively Enhancing Product Reviews with Chrome AI / / No Comments While writing up my last blog post I mentioned that a new idea had occurred to me in regards to employing sentimenet analysis with Chrome’s built-in AI support (that, remember, is still way in beta). At lunch today I took a quick stab at a simple demo of what I had in mind and honestly, I’m pretty happy with how it came out. The Initial Demo The idea I had was an "imagined" ecommerce site with product reviews. I went to Google AI Studio and used a prompt to generate a set of product reviews. I used this prompt: Generate a list of 20 product reviews for a cat carrier named Cat Carrier Ultra 1000. The reviews should be a mix of positive and negative, with some being extremely... more → Posted in: JavaScript Tagged with: Chrome, Enhancing, Product, Progressively, reviews
Getting Image Insights with Built-in Chrome AI and EXIF Data / / No Comments It’s been a busy few weeks for Chrome’s Built-in AI support. Since the last time I blogged about it, four features have gone GA (which still means they are Chrome only but not behind a flag anymore): Translator Summarizer Language Detector Prompt API (for extensions only) And while announced back at the end of May, Gemma 3n as a model is available in Canary, Dev, and Beta Chrome builds. To be clear, the percentage of folks who can use these new features is still really low, but all of these features also work really well in progressive enhancement, and can be backed up by server calls to an API if need be. I continue to be really excited about the possibilities these APIs unlock,... more → Posted in: JavaScript Tagged with: Builtin, Chrome, data, EXIF, Getting, Image, Insights
Adding Translation with a Web Component and Chrome AI / / No Comments A few days ago, I blogged about using Chrome’s built-in generative AI features (which are still super duper too early to even consider for production) to add on-device translation capabilities to a web app. It got me thinking, what if we could do translation automatically via a web component? If for some reason it failed, that would be fine as the original text would still be there, but in cases where it could work, it would be automatic. Here’s what I built. First, I whipped up a quick HTML demo of the text I’d like translated: <translate-text>Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the... more → Posted in: JavaScript Tagged with: Adding, Chrome, Component, Translation
Using Chrome AI for Translation / / No Comments I’ve done a couple blog posts now on Chrome’s efforts to bring generative AI to the browser. It’s still somewhat of a rough process (remember, you can sign up for access to test and learn more at the intro post from the Chrome engineers), but it’s getting better over time. One thing I mentioned in my last post ("Using Chrome AI to Rewrite Text") was how the Chrome team is shipping focused APIs for specific purposes, not just general Q and A. In that previous post, I demonstrated an example of the Rewriter API. As yet another example of this, you can now test out on device translation. As with everything else I’ve shared in this space, you should consider... more → Posted in: JavaScript Tagged with: Chrome, Translation, using
Using Chrome AI to Rewrite Text / / No Comments Earlier this month, I discussed how Chrome’s upcoming built-in AI support was adding new features specifically tailored to certain use-cases. In that post, I looked at the Summarizer API. For today, I decided to take a look at the rewriter API. As a quick reminder, this is very early on, and if you want to try this yourself, you should hit the sign-up form and read the intro post from the Chrome folks first. Obviously, everything I’m going to show below probably will, almost certainly will, change before shipping. Ok, with that out of the way, let’s talk rewriting, specifically, how the Chrome API operates. Given a set of source input, the API can shorten, or lengthen the input,... more → Posted in: JavaScript Tagged with: Chrome, Rewrite, text, using