Member-only story
OpenAI GPT-4 and GPT-3.5-Turbo Updates: Cheaper and Larger Context

Today, I woke up to an exciting email from OpenAI announcing upgrades to its text-generator AI models and reduced pricing!

Let’s unpack these new features one by one.
Function calling
Function calling allows developers to describe functions to the model and have it 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.
Here’s an example:
{
"model": "gpt-3.5-turbo-0613",
"messages": [
{"role": "user", "content": "Send Jim an email asking for a coffee date?"}
],
"functions": [
{
"name": "send_email",
"description": "Please send an email.",
"parameters": {
"type": "object",
"properties": {
"to_address": {
"type": "string",
"description": "To address for email"
},
"subject": {
"type": "string",
"description": "subject of the email"
},
"body": {
"type": "string",
"description": "Body of the email"
}
}
}
}
]
}
I sent the POST request via Postman; you can try it out for yourself here.

This is the response I received from the model in JSON format.
{
"id": "chatcmpl-7RATyvNoqYlbkoeffEkIEbXUL7zqW",
"object": "chat.completion",
"created": 1686709506,
"model": "gpt-3.5-turbo-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"function_call": {
"name": "send_email",
"arguments": "{\n \"to_address\": \"jim@example.com\",\n \"subject\": \"Coffee Date\",\n \"body\": \"Hi…