4 ms·
Nice. Just to point out, calling a sequence of functions is what GPT-4 does automatically if you keep feeding it the responses and it is clear to it that is nec
by ilaksh 3y ago
Nice. Just to point out, calling a sequence of functions is what GPT-4 does automatically if you keep feeding it the responses and it is clear to it that is necessary given it's instructions.
So the main point of this seems to be extracting the interface from the module and converting it into the OpenAI API call's functions format.
It's a good idea. But for me I would rather just have an npm package with a function like
extractFunctions(srcFilename)
which I could then use inside of my own project which already handles the rest of it.
- andrewguenther 3y agoYep. I built this for Python recently and it uses introspection to automatically build this same info. It's maybe 100 lines in total? The OpenAI API is pretty amazing.
- lukasb 3y agoWell, this knows when to stop calling GPT-4, which seems non-trivial.
- wyozi 3y agoChatGPT does this automatically, if you pass in `function_call: "auto"`
- lukasb 3y agoHow would this work? Say I need multiple function calls to handle a user prompt. OpenAI will only supply one function call at a time. My understanding is that "auto" just lets it choose which function to call, but you still have to know that you need to call it multiple times, and when to stop.
- lgas 3y agoIt can make multiple function calls. For example I have it hooked up to edit word documents, and I can say "create a word document, add a paragraph describing yourself and then add title 'xyz'" and it will make three separate function calls to do this before responding saying that it's completed the task.
- jrmyphlmn 3y agoThank you! You're right; the main focus right now is extraction. One aspect I'm excited about is the possibility of rendering the JSON outputs from these function calls into UI components, as previewed here: https://symphony.run/showcase https://symphony.run/showcase. Using a function's type definitions is a nice starting point to embed interfaces into the conversation. Additionally, I hope to make the toolkit language-agnostic. I'd like to incorporate some of my .py and .rs scripts to make them ready for use as well. Not sure if packaging it as an npm package would go against that objective, but will definitely consider :)