4 ms·
Nice 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
by tuchsen 3y ago
Nice 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.