Using AI in the Browser for Typo Rewriting

Last week I gave a presentation on Chrome’s new built-in AI support (I’ll link the video at the end) and it’s gotten me inspired to consider new and different ways these APIs can be used to enhance the user experience. These APIs still aren’t quite ready for production use, and it’s absolutely possible we may never see these in Safari or Firefox, but the possibility of using them to enhance an application where available is exciting. For today, I want to share an interesting use case that occurred to me a few weeks ago. One of the APIs being built is a translation API (along with a language detection) API as well. In general the idea here is to go from one language... more →
Posted in: JavaScript

Using Java Libraries in BoxLang

One of the aspects that makes BoxLang compelling is that it runs on top of the Java Virtual Machine which means you get access to any Java library out there. This is something ColdFusion has as well and in the past, I’ve integrated Java libraries into my web apps to make use of open source from the Java community. Best of all, you don’t really need any Java knowledge to do this. Typically libraries will provide good docs and and examples and the mental model of translating a Java example to BoxLang’s language is fairly simple. A few days ago, I blogged an example of parallel processing in BoxLang and in one of the samples, I did a tiny bit of RSS feed processing. I mentioned... more →
Posted in: JavaScript

Using Parallel Looping in BoxLang

Last week I wrote about converting a Python file search script to BoxLang. In that post (and the original Python version) I mentioned how the utility wasn’t terribly efficient as it needed to recreate an index every time it ran. Despite this, the performance was pretty good, taking about two seconds or so to generate the file index from near seven thousand Markdown files. Right after I shared that post, Luis Majano shared an interesting performance tweak I had missed. In BoxLang (and to be fair, this is a feature both Lucee and ColdFusion have as well), when you loop over arrays, structures, and queries, you can enable parallel execution by simply adding an additional argument to the loop.... more →
Posted in: JavaScript

Using Intl.DurationFormat for Localized Durations

Last year I had the opportunity to give a talk on the web platform’s Intl specification. This made me incredibly happy because in preparing for the presentation, I discovered so many cool features and capabilities of the spec that I had no idea existed. Almost a year ago, I wrote up a blog post on Intl.RelativeTimeFormat, talking about how the API was easy to use, but perhaps a bit difficult when dealing when determining the best values to use when formatting dynamic dates. Today, I’m going to turn my attention to a related spec, Intl.DurationFormat The Basics The DurationFormat API works like so: Given a locale (defaulting to the browser’s locale) Given a set of values representing... more →
Posted in: JavaScript

Using Generative AI to Help in Customer Service

Ok, before I begin, let me be absolutely clear. I do not think AI can replace customer support. I do think it can supplement and help customer support however, and I’d like to share an example of what this could look like. Imagine your service has a customer service form or email address. Typically, you type in your question, send it off, and wait. But what if you could provide an AI generated answer immediately while the person waits? At worse it doesn’t help. At best, it could be exactly what they need and the request could be terminated saving everyone time. Let’s consider an example of this. Setting up the AI/RAG System Let’s start with the most complex part, the AI/RAG... more →
Posted in: JavaScript

Using Transformers.js for AI in the Browser

Two weeks ago I had the pleasure of attending, and speaking at, connect.tech. One of the cooler presentations I saw was from Danielle Maxwell where she discussed usingAI in the browser and introduced me to Transformers.js. I’d heard of this before, but wasn’t quite aware of how easy it was to use. While this isn’t necessarily going to replace a "real" GenAI server, it does feel compelling enough to something to consider. As my readers know, I’ve been playing with Chrome’s attempt to bake this in as well, and while that’s not quite ready for real use yet, Transformers.js feels like something you could play with right now. How to get started? Using... more →
Posted in: JavaScript

Using Generative AI to Parse Web Pages into Data

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

Using Your Favicon for Monitoring Long Processes

A week or so ago, I was doing some tests on Google Colab and noticed something interesting. The notebook I was using was one that took one to two minutes to process. Before I’d start the process, the favicon looked like so: After kicking off the workflow, the favicon changed like so: To be honest, I had not noticed it earlier, but I only fairly recently started using a somewhat ‘slow’ notebook so it’s possible I just didn’t need it before. Realizing how it’s being used now, I thought it was an excellent user experience feature and looked into how to use it in my own applications. Changing the Favicon Ok, so this part is stupid easy. Assuming you’ve... more →
Posted in: JavaScript
1 2 3 9