Anvil UI for OpenAI

This morning had a very quick Twitter exchange about “wouldn’t it be nice to have a UI for logging outputs for AI chat, to provide an audit trail for ideas.”

Added GIF of the app!

anvilopenaiapp

Clone and tinker:

https://anvil.works/build#clone:JF2OSZV3VSHZFNIE=RNOYZTGTMO7L6HXYZLHFNQKV

You’ll need to add your secret key to the secrets manager and call it “openaikey.”

I’ve made a quick video tutorial to accompany this:

https://youtu.be/woBqV3I6Htg

10 Likes

@socint , I cloned it and looked at the code. Very clean and very clear, nice work!

Thank you! My whole approach to coding was born on a Spectrum in the 80s and the last few years I’ve really knuckled down with a firm focus on Anvil. As a platform is practically begs for clean code and drills bad habits out of you!!

1 Like

I liked the video.

It focuses more on Anvil than on OpenAI itself, but I like how the video walks through each page to show the various components that make up the app.

It may seem unusual to watch a video about an app without actually seeing the app in action, but after watching the video, it becomes clear how the app works. Then, if you are interested in trying it out, you can simply clone it and test it yourself.

1 Like

I totally forgot to put the video of the app itself in the post!! Have added it as a GIF. Grazie, Stefano!

Great video.

Some not yet documented features of accelerated tables that might be of interest


app_tables.logs.search(user=user).delete_all_rows()

And


rows = app_tables.logs.search(user=user)

with anvil.tables.batch_delete:
    for row in rows:
        row.delete()

You should consider turning it into a dev.to post. Seems perfect source material :blush:

2 Likes

Thanks Stu, implemented that delete_all_rows practically with a YOINK sound effect.

Will be sure to pop something up on dev.to later too!

2 Likes