Function Calling is a powerful feature of OpenAI's GPT 3 and GPT 4 which allows you to build applications powered by reliable, structured output from the AI model.
The GPT LLMs cannot actually run your functions. Your code will still do that, no matter the language or architecture.
Function Calling translates your user's chat input or system prompts into instructions for your code. The AI will select which function to call, and generate a JSON object with the inputs for the function based on the prompt.
It's like having a human operator who can understand natural language inputs, then use it to trigger a pre-defined code operation and set the input for that operation. A translator between the user's natural language, and your code.
Using the Function Calling API as a middle-man, you can intelligently convert user's natural langauge input into structured parameters for your code functions.
For example, if your goal is to allow users to order products with natural language, you might use Function Calling to figure out the quantity and name of the product from the user's input, then use normal JavaScript functions and an e-commerce API to add the product to the user's cart.
Frequently Asked Questions