3 ms·
Show HN: ChatGPT to control your own app (text-to-action library)
ActionIt is a text-to-action library built to make it easier to perform actions based on natural language input. It opens the way for applications that don't only retrieve information but actually interact with functions, extracting necessary parameters or asking follow-up questions where necessary.
In simple terms, your functions are presented to ChatGPT and the correct one is chosen and executed based on a natural language input.
Would love any feedback or feature requests:)
- tuchsen 3y agoNice job! I think you've really made the easiest possible API surface for adding LLM into apps. I'm not sure LangChain is going to be the best way to integrate LLM into apps in the future, and ActionIt definitely demonstrates that it's at least not the simplest. I'm a little unclear on one thing though. How are you handling the parsing of parameter names when passing prompts to the model? In your example you ask the LLM to "Find the sum of 1 and 8" and then that ends up being bound to x and y somehow. I know it doesn't matter in the case of adding two numbers because they're commutative, but that's hardly ever the case. I must be missing some magic somewhere.
- alexgriffiths31 3y agoAppreciate it! That was always the plan to make this as simple and understandable as possible. Regarding the parameters, I prompt GPT to to return the function name as well as an object for the params in JSON. The acceptable params are passed in the prompt just by stringifying the 'parameters' object passed in the addFunction() function. This means it works best when the function parameters are extremely descriptive. I've also found it is important to check all params to ensure they're the correct type, not null, etc, directly in the function. I've also been meaning to implement some retry logic so that if a passed parameter is wrong, the function can throw an error and this error will be passed back to GPT to allow it to retry.
- quickthrower2 3y agoIt looks great! Lots of cool things could be built on this. I might give it a try on a hobby app.
- alexgriffiths31 3y agoAwesome - I'd love to know what you build and what you'd like added to the library!