Function calling: GPT learns to speak JSON
In one sentence OpenAI adds 'function calling' to the Chat Completions API: developers describe functions with a JSON schema and GPT-4 or GPT-3.5-turbo (0613 versions) can respond with a JSON object stating which function to call and with which arguments.
Before June 13, 2023, if you wanted GPT to call an external API (say, check the weather), you had to coax it through the prompt into producing clean JSON, and the result was not always usable.
With function calling this becomes part of the API: you describe the function (name, description, parameters in JSON Schema) and the model, when it sees fit, responds with the function name and the arguments in JSON. The developer's code runs the function and returns the result to the model.
It is not an absolute guarantee: the JSON produced can still be malformed or contain hallucinated parameters, so it must be validated. In the same announcement OpenAI releases gpt-3.5-turbo-16k and cuts some prices.
Companies
OpenAI
Tools
GPT-4, GPT-3.5-turbo
Tags
Sources