In API calls, you can describe functions and let the model intelligently choose to output a JSON object containing parameters in order to call one or more functions. The Chat Completions API does not call the function; instead, the model generates JSON that you can use to call the function in your code.
What's new in function calling V2?
OpenAI made three updates to function calling in the API:
"JSON mode" now allows the model to output a string that parses as valid JSON
The ability to call multiple functions from one message
Improved performance in matching required properties or schema (if provided)
What is JSON mode?
By setting response_format: { type: "json_object" } when calling gpt-3.5-turbo-1106 or newer, or gpt-4-1106-preview, these models will constrain their output to generate a string that can be parsed as valid JSON.