Cached at:
04/20/26, 02:51 PM
# Function calling and other API updates
Source: [https://openai.com/index/function-calling-and-other-api-updates/](https://openai.com/index/function-calling-and-other-api-updates/)
*July 20, 2023 update:*
We previously communicated to developers that`gpt\-3\.5\-turbo\-0301`,`gpt\-4\-0314`and`gpt\-4\-32k\-0314`models were scheduled for sunset on Sept 13, 2023\. After reviewing feedback from customers and our community, we are extending support for those models until at least June 13, 2024\.
When we release new model versions, our top priority is to make newer models smarter across the board\. We are targeting improvements on a large number of axes, such as instruction following, factual accuracy, and refusal behavior\. For instance, the`gpt\-4\-0613`model introduced last month resulted in significant improvement on calling functions\.
We look at a large number of evaluation metrics to determine if a new model should be released\. While the majority of metrics have improved, there may be some tasks where the performance gets worse\. This is why we allow API users to pin the model version\. For example, you can use`gpt\-4\-0314`instead of the generic`gpt\-4`, which points to the latest model version\. Each individually pinned model is stable, meaning that we won’t make changes that impact the outputs\.
We are working hard to ensure that new versions result in improvements across a comprehensive range of tasks\. That said, our evaluation methodology isn’t perfect, and we’re constantly improving it\. One way to help us ensure new models get better at domains you care about, is to contribute to[the OpenAI Evals library\(opens in a new window\)](https://github.com/openai/evals/tree/main)to report shortcomings in our models\.
We understand that model upgrades and behavior changes can be disruptive to your applications\. We are working on ways to give developers more stability and visibility into how we release and deprecate models\.
---
Developers can now describe functions to`gpt\-4\-0613`and`gpt\-3\.5\-turbo\-0613`, and have the model intelligently choose to output a JSON object containing arguments to call those functions\. This is a new way to more reliably connect GPT's capabilities with external tools and APIs\.
These models have been fine\-tuned to both detect when a function needs to be called \(depending on the user’s input\) and to respond with JSON that adheres to the function signature\. Function calling allows developers to more reliably get structured data back from the model\. For example, developers can:
- Create chatbots that answer questions by calling external tools \(e\.g\., like ChatGPT Plugins\)
Convert queries such as “Email Anya to see if she wants to get coffee next Friday” to a function call like`send\_email\(to: string, body: string\)`, or “What’s the weather like in Boston?” to`get\_current\_weather\(location: string, unit: 'celsius' \| 'fahrenheit'\)`\.
- Convert natural language into API calls or database queries
Convert “Who are my top ten customers this month?” to an internal API call such as`get\_customers\_by\_revenue\(start\_date: string, end\_date: string, limit: int\)`, or “How many orders did Acme, Inc\. place last month?” to a SQL query using`sql\_query\(query: string\)`\.
- Extract structured data from text
Define a function called`extract\_people\_data\(people: \[\{name: string, birthday: string, location: string\}\]\)`, to extract all people mentioned in a Wikipedia article\.
These use cases are enabled by new API parameters in our`/v1/chat/completions`endpoint,`functions`and`function\_call`, that allow developers to describe functions to the model via JSON Schema, and optionally ask it to call a specific function\. Get started with our[developer documentation\(opens in a new window\)](https://platform.openai.com/docs/guides/gpt/function-calling)and[add evals\(opens in a new window\)](https://github.com/openai/evals)if you find cases where function calling could be improved
Since the alpha release of ChatGPT plugins, we have learned much about making tools and language models work together safely\. However, there are still open research questions\. For example, a proof\-of\-concept exploit illustrates how untrusted data from a tool’s output can instruct the model to perform unintended actions\. We are working to mitigate these and other risks\. Developers can protect their applications by only consuming information from trusted tools and by including user confirmation steps before performing actions with real\-world impact, such as sending an email, posting online, or making a purchase\.