LLMs as a component

Source code: github.com/neolefty/madlibs.

Large Language Models are everywhere, and programmers should all be trying them out. So here’s a really simple app!

full screen view

It’s just a chat UI with two additions:

  • A framing prompt, basically “Respond with Mad Libs, formatted so I can process them,” and
  • Some text substitution from inputs.

A framework can really help. This app uses Vercel’s AI SDK, a TypeScript library specialized for building interactive web applications. Another good one, which has both Python and JavaScript versions, is LangChain / LangGraph — for building “Applications that can reason”.

So simple it’s embarrassing. A good place to start, right?

Bugs

  • Sometimest the streaming response gets cut off. That may be because of bugs in OpenNext. It never fails in development — I should really see how it does when hosted at Vercel instead.
This entry was posted in Bedtime Story, Techno-biological. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.