Live data from Hacker News

Show HN: Superfunctions – AI prompt templates as an API

superfunctions.versoly.page

11–17 of 17 posts

Re: Show HN: Superfunctions – AI prompt templates as an API

#11
post #10

If one creates a new app (which was unclear what that even means), then the resulting 403 makes the site never load again (just choosing instead to say "Loading ..." forever) Kind of related to that, if a user created a new app, it's weird that the new app would be 403 to that user

Sorry about that, should be fixed now.

An app is just way to group multiple related functions/prompts.

It was throwing a 403 because it thought the app didnt belong to your user. Im storing those permissions in the session and recently introduced a bug that only updated the user app permissions on login.

Youre one of the first users, so thanks for reporting that. Let me know if you have any other feedback.

Re: Show HN: Superfunctions – AI prompt templates as an API

#12
post #3

Interesting project. How do you propose to sanitize the results? I used your example endpoint above and called it for chartreuse. Instead of just giving me a direct hex code like `#0000FF` for the blue example, it returned `The hex code for chartreuse in CSS is #7FFF00.`, which I'm pretty sure most systems would choke on. It seems to do this for a about 1/3 to 1/4 of my queries. Asking for a color it doesn't like cau…

Thanks! That specific prompt is just an example and it's pretty bad, it was the shortest and simplest prompt I could come up with that would be easily understood. You can set response content-types (text, html, json, etc...). If you use json it will get pretty good results because I have some is some logic to attempt to pick out json or json5 objects from the text output. I dont yet have logic to support json arrays,…

I'll say kind of kills the enthusiasm if you don't have validation support.

I get the need for an MVP, but even a basic "Provide a regex and the max number of times to retry" would make this infinitely more useful.

That also lets you expand the concept down the line, like surfacing how a prompt change lead to increased retries.

Re: Show HN: Superfunctions – AI prompt templates as an API

#13

Earlier quoted context omitted.

Thanks! That specific prompt is just an example and it's pretty bad, it was the shortest and simplest prompt I could come up with that would be easily understood. You can set response content-types (text, html, json, etc...). If you use json it will get pretty good results because I have some is some logic to attempt to pick out json or json5 objects from the text output. I dont yet have logic to support json arrays,…

I'll say kind of kills the enthusiasm if you don't have validation support. I get the need for an MVP, but even a basic "Provide a regex and the max number of times to retry" would make this infinitely more useful. That also lets you expand the concept down the line, like surfacing how a prompt change lead to increased retries.

Originally I planned to include output validation using zod but I scrapped it in favor of simplicity. I never considered regex validation that would be much simpler.

I'm open to adding validation if it adds value. Thanks for your feedback!

Re: Show HN: Superfunctions – AI prompt templates as an API

#16
Funny demo! I really did LOL (wont spoil it)

And beyond that interesting generative AI use case. The big challenge is thinking what is possible.

The next step might be simple chaining (of APIs not LLMs). So the API calls another API (e.g. get celeb news) then gives that info and a prompt to return a value. For example the same celeb api but with latest news in under 140 characters.

Re: Show HN: Superfunctions – AI prompt templates as an API

#17

Funny demo! I really did LOL (wont spoil it) And beyond that interesting generative AI use case. The big challenge is thinking what is possible. The next step might be simple chaining (of APIs not LLMs). So the API calls another API (e.g. get celeb news) then gives that info and a prompt to return a value. For example the same celeb api but with latest news in under 140 characters.

Thanks!

Actually, this project is born out of the chaining idea youre talking about. I've been dogfooding this with another app like google translate for language learners (https://languageread.com/ ugly and early for now). It requires a lot of chaining, and splitting text, and composing prompts.

So my first attempt for superfunctions focused on that chaining idea, my approach was prompts backed by AWS stepfunctions. I pretty quickly realized that it would help a lot to have a more primitive layer, so I switched focus to build a lower level layer that turns prompts into single units of execution.

Right now for that language learning app, I'm chaining everything on the client using bluebird promises (going to blog about this soon), this approach comes with a lot of pain points, so I'm still hoping add that composability/chaining functionality as a layer on top of superfunctions later.

Post reply on HN