logoalt Hacker News

lysecret10/01/20241 replyview on HN

Using structured outputs for generative ui is such a cool idea does anyone know some cool web demos related to this ?


Replies

jiggawatts10/01/2024

I just had an evil thought: once AIs are fast enough, it would be possible to create a “dynamic” user interface on the fly using an AI. Instead of Java or C# code running in an event loop processing mouse clicks, in principle we could have a chat bot generate the UI elements in a script like WPF or plain HTML and process user mouse and keyboard input events!

If you squint at it, this is what chat bots do now, except with a “terminal” style text UI instead of a GUI or true Web UI.

The first incremental step had already been taken: pretty-printing of maths and code. Interactive components are a logical next step.

It would be a mere afternoon of work to write a web server where the dozens of “controllers” is replaced with a single call to an LLM API that simply sends the previous page HTML and the request HTML with headers and all.

“Based on the previous HTML above and the HTTP request below, output the response HTML.”

Just sprinkle on some function calling and a database schema, and the site is done!

show 2 replies