Submitted by xander76 t3_125y2et in MachineLearning
imaginary.dev is a project I built to allow web developers to use GPT to easily add AI features to their existing web user interfaces. All a developer does is declares a function prototype in TypeScript with a good comment saying what the function should do, and then they can call the function from other TypeScript and JavaScript code, even though they've never implemented the function in question. It looks something like:
/**
- This function takes in a blog post text and returns at least 5 good titles for the blog post.
- The titles should be snappy and interesting and entice people to click on the blog post.
- @param blogPostText - string with the blog post text
- @returns an array of at least 5 good, enticing titles for the blog post.
- @imaginary
*/
declare function titleForBlogPost(blogPostText: string): Promise<Array<string>>;
Under the covers, we've written a TypeScript and Babel plugin that replaces these "imaginary function" declarations with runtime calls to GPT asking GPT what the theoretical function would return for a particular set of inputs. So it's not using GPT to write code (like CoPilot or Ghostwriter); it's using GPT to act as the runtime. This gives you freedom to implement things that you could never do in traditional programming: classification, extraction of structured information out of human language, translation, spell checking, creative generation, etc.
Here's a quick screencast where I show off adding intelligent features to a simple blog post web app: https://www.loom.com/share/b367f4863fe843998270121131ae04d9
Let me know what you think. Is this useful? Is this something you think you'd enjoy using? Is this a good direction to take web development? Happy to hear any and all feedback!
More info on the idea: https://imaginary.dev/
HangOutWithMyYangOut t1_je6m0vt wrote
This is incredibly creative. Any chance you'll be putting an example project on github