Home » OpenAI Adds Function Calling to GPT-4 and GPT-3.5 APIs

OpenAI Adds Function Calling to GPT-4 and GPT-3.5 APIs

By

–

OpenAI Adds Function Calling to GPT-4 and GPT-3.5 APIs

Ask OpenAI’s models for the weather in Boston and, as of this update, they can do more than guess. The company has added “function calling” to GPT-4 and GPT-3.5-turbo, a feature that lets developers describe programming functions to the model, which can then generate code to execute them. OpenAI laid out the process in a blog post, and Tech Times used the Boston forecast as its example.

The feature ships in the gpt-3.5-turbo-0613 and gpt-4-0613 models. A developer who explained the workflow on LinkedIn listed three uses: chatbots that answer questions by calling external APIs, much as ChatGPT plugins do; converting natural language into API calls; and pulling structured data out of plain text.

How it works

The same developer broke the exchange into five steps:

First, the program sends the model the user’s query along with a functions array, where each function gets a name, a description and documented parameter types. Then it checks whether the model wants to call one. If so, the JSON response carries the parameters. The program runs the function and sends the result back, and the model replies with a message about the outcome, or asks for another function.

The model never runs anything itself. It asks, and the developer’s code does the work.

Other changes in the update

GPT-3.5-turbo also got a larger context window, so it can refer back to more of the preceding conversation before it loses track of details. The bigger-window version costs twice as much as the standard one. The standard version got cheaper: Mashable reported a 25 percent price cut.

Tech Times, citing Search Engine Journal, listed companies already building on OpenAI’s models. Microsoft uses them in Bing and Office. Snapchat’s My AI chatbot runs on GPT and can now send and read image snaps. Salesforce built Einstein GPT, billed as the first generative AI CRM product. Morgan Stanley has access to GPT-4, and HubSpot built ChatSpot.ai on it. Stripe uses GPT for customer insight and fraud detection, GetResponse for an email generator, and Instacart for a shopping chatbot. GitHub Copilot builds on OpenAI Codex, an integration that has drawn a legal dispute over copyright.

Sources

Get breaking stories first on our Telegram channel.

More stories by

Most read

Consumer Tech & Goods

Pets

Gaming & Esports

Gaming