Skip to main content

OpenAI Announces API Updates

OpenAI has announced a range of API updates, including both improvements to price and performance, as well as an exciting new function-calling feature.
Created on June 16|Last edited on June 16
OpenAI has released some notable updates to its API. They've introduced advanced versions of their GPT models, GPT-4 and GPT-3.5-turbo, which provide improved steerability. This enhancement means the models can now better accommodate and respond to different user inputs. Accompanying this upgrade is a 16k context version of GPT-3.5-turbo, a significant increase from the standard 4k context, enabling a better understanding of larger text inputs.

Price Improvements

In addition, OpenAI has implemented substantial cost reductions, marking a 75% decrease for the text-embedding-ada-002 model and a 25% drop for input tokens of GPT-3.5-turbo. In addition, OpenAI also announced the deprecation timeline for the gpt-3.5-turbo-0301 and GPT-4-0314 models.

Function Calling

In addition to these improvements, function calling is an interesting feature in the latest GPT-4 and GPT-3.5 Turbo models, empowering developers to describe specific functions to these models, and prompting them to output structured JSON objects that align with the functions' requirements. This enables seamless integration of GPT's capabilities with external APIs or tools.
The models are fine-tuned to discern when a function needs to be activated based on user input. For instance, if a user inquires, "What's the weather like in Boston?", the model can respond with an actionable function call such as get_current_weather(location: string, unit: 'celsius' | 'Fahrenheit'). Function calling makes creating intelligent chatbots much easier, converting natural language into API calls or database queries, and extracting structured data from text.

A Function Calling Example

To illustrate, if a user asks, "What’s the weather like in Boston right now?", the model can be called with the user's query and an accompanying function, get_current_weather, with the necessary parameters. The model's response can then be used to interact with a third-party weather API. The data returned from the API can be fed back to the model, which summarizes the data, concluding with a human-readable output like, "The weather in Boston is currently sunny with a temperature of 22 degrees Celsius." This showcases the potential of function calling in automating and improving the reliability of interactions with external tools.
Here is what the API calls and application workflow looks like for this simple example!
Available Functions are described in the API call
Model responds with a JSON object used to call your API, and the API call in the app
The model parses your output from the API and creates a natural language response
Tags: ML News
Iterate on AI agents and models faster. Try Weights & Biases today.