2 ms·
Paraphrasing my response from a previous thread (https://news.ycombinator.com/item?id=36331206 https://news.ycombinator.com/item?id=36331206) and having done so
by minimaxir 3y ago
Paraphrasing my response from a previous thread (https://news.ycombinator.com/item?id=36331206 https://news.ycombinator.com/item?id=36331206) and having done some actual testing of the function calling feature, there's two things ChatGPT can now do:
1. You can input and/or output structured data from ChatGPT.
2. ChatGPT can select from a list of functions and their schema and use one (with "use" being telling the user to use said function and providing input parameters), or use none at all if not applicable.
#1 is the more interesting use case I suspect people will use and in my testing it's incredibly effective and stable. #2 is an extention of modern tooling, but nothing new and it's up in the air whether it's more robust; the demos OpenAI have aren't great in that aspect.
This article brushes it off but the actual user implementation of function selection is a pain in the ass (and also passing structured input data) that can't easily be explained in a tutorial, and like using LangChain it increases the information asymmetry for people getting into modern AI.
The actual process of having ChatGPT select from a discrete set of outputs is very simple in practice and it's incredibly annoying that people consider it to the the "killer app" of LangChain. I might have to accelerate my blog post on how to do it efficiently, but in practice it's just a simple, small prompt: https://github.com/minimaxir/simpleaichat/blob/main/PROMPTS.md#tools https://github.com/minimaxir/simpleaichat/blob/main/PROMPTS....
- TeMPOraL 3y ago> This article brushes it off but the actual user implementation of function selection is a pain in the ass (and also passing structured input data) that can't easily be explained in a tutorial, and like using LangChain it increases the information asymmetry for people getting into modern AI. Stupid question, but... can't you just feed the relevant bit of API docs to GPT-4 and kindly ask it to write you the user-side call dispatcher, complete with error handling? :).
- minimaxir 3y agoUnfortunately, ChatGPT's cutoff date is still October 2021.
- TeMPOraL 3y agoWhy would it matter, though? The problem definition is literally "this is JSON response I'm getting: {JSON example from OpenAI docs}; write me code in {preferred programming language} that dispatches function calls based on it; ensure there's error handling in case input doesn't match this format or isn't even a valid JSON in the first place". Perhaps combined with: "here is a bunch of function declarations: {taken from OpenAI example}; here is a corresponding JSON schema {also taken from OpenAI example}; based on this example, please write me a JSON schema for the following function declarations {actual functions you want to provide}." That is, the problem doesn't rely on anything that's less than 5-8 years old (or more, I don't remember how old the JSON as we know it is).