ChatGPT-function-calling-API

Last updated on August 19th, 2024 at 03:24 pm

Step into the world of advanced AI with OpenAI’s groundbreaking updates. Experience the power of steerable API models, extended context, and affordable function calling, revolutionizing the way we interact with artificial intelligence. Explore the possibilities and unlock new horizons in this comprehensive guide.
OpenAI-Function-Calling-update

OpenAI has recently introduced gpt-3.5-turbo and gpt-4, models that have already showcased impressive applications developed by talented individuals. The company is excited to share the latest updates that promise to enhance users’ AI experiences.


FUNCTION CALLING:

The first update is the introduction of function calling capability in the Chat Completions API. This feature allows developers to describe functions to the models, enabling them to generate a JSON object with arguments to call those functions.

It provides a reliable way to connect GPT’s capabilities with external tools and APIs, empowering developers to effortlessly obtain structured data from the models. The possibilities include creating chatbots that can utilize external tools, convert natural language into API calls, or perform database queries.


Function calling example in 3 steps:

#1 OpenAI API : Call the model with functions and the user’s input. This step will generate a JSON object with arguments to call the desired function.
Ex: What’s the weather like in New York right now?

#2 Third party API : Use the model response to call your API.
Ex: curl https://weatherapi.com/endpoint
The API response might looks like: { “temperature”: 24, “unit”: “celsius”, “description”: “Sunny” }

#3 OpenAI API : Send the response back to the model to summarize.
Response : The weather in New York is currently sunny with a temperature of 24 degrees Celsius.

Note: OpenAI urges developers to 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.

Please read OpenAI’s developer guide for more information.


NEW MODELS:

OpenAI is proud to present the latest models that will redefine your AI experience. GPT-4’s updated and improved model (gpt-4-0613), comes with the highly anticipated function calling capability. Additionally, gpt-4-32k-0613 offers an extended context length, enabling better comprehension of larger texts.

GPT-3.5 Turbo has also received significant enhancements. It now features function calling as well as more reliable steerability via the system message,similar to GPT-4 allowing developers to guide the model’s responses more effectively.

Moreover, gpt-3.5-turbo-16k provides an increased context length, enabling the model to handle approximately 20 pages of text in a single request.


LOWER COSTS:

OpenAI has been working to make their systems more efficient and affordable for developers. As part of this effort, they have significantly reduced the pricing for embeddings model and gpt-3.5-turbo.

The popular embeddings model, text-embedding-ada-002, now comes with a 75% cost reduction ($0.0001 per 1K tokens). Developers can leverage the power of gpt-3.5-turbo at a reduced cost of input tokens by 25%.

This means you can now use gpt-3.5-turbo for just $0.0015 per 1K input tokens and $0.002 per 1K output tokens, which equates to roughly 700 pages per dollar, allowing you to achieve remarkable results without breaking the bank.

For those who require even larger context lengths, can leverage gpt-3.5-turbo-16k, which comes at a competitive price of $0.003 per 1K input tokens and $0.004 per 1K output tokens.


MODEL DEPRECATIONS:

According to OpenAI, applications using the stable model names (gpt-3.5-turbo, gpt-4, and gpt-4-32k) will automatically be upgraded to the new models on June 27th.

Developers who need more time to transition can continue using the older models by specifying gpt-3.5-turbo-0301, gpt-4-0314, or gpt-4-32k-0314 in the ‘model’ parameter of their API request. These older models will be accessible through September 13th, after which requests specifying those model names will fail.

To stay up to date on model deprecations, please visit OpenAI’s model deprecation page.


KEY HIGHLIGHTS:

OpenAI introduces a new function calling capability in the Chat Completions API, enabling developers to enhance the interaction between GPT models and external tools or APIs.

Upgraded and more steerable versions of gpt-4 (gpt-4-0613) and gpt-3.5-turbo (gpt-3.5-turbo-0613) provide enhanced control and improved performance.

It also introduces gpt-3.5-turbo-16k, which offers a larger context length of 16k compared to the standard 4k version, enabling better comprehension of longer texts.

OpenAI reduces the cost of their state-of-the-art embeddings model (text-embedding-ada-002) by 75%, making it more affordable for developers to leverage its powerful capabilities.

The cost of input tokens for gpt-3.5-turbo is reduced by 25%, allowing developers to achieve remarkable results at a lower price.


OpenAI announces the deprecation timeline for the gpt-3.5-turbo-0301 and gpt-4-0314 models, ensuring a smooth transition to newer versions and encouraging developers to upgrade to the latest models.


OpenAI’s commitment to providing cost-effective solutions empowers developers to explore the full potential of AI without financial constraints, source.


Connect the dots of AI expertise by exploring these thought-provoking articles that align with your interests: ChatGPT, GPT-3, InstructGPT, ChatGPT Whisper API, GPT-3 Vs InstructGPT, GPT-4, ChatGPT Plugins