DEV Community

Cover image for TL;DR: new OpenAI Function Calling
Dom Sipowicz
Dom Sipowicz

Posted on

TL;DR: new OpenAI Function Calling

  • What does this new OpenAI Function Calling mean?
  • What are the use cases for the new OpenAI Function Calling?

Recently, OpenAI announced a few new features:


TL;DR version of my random thoughts:

  • This is a cool name that implies some kind of execution unit. You read it and think of Amazon Lambda or Vercel Edge Function. That's pretty cool!

  • This is exactly how chaining should look from the start. This API is not meant to replace LangChain, but rather to provide a simple and universal interface between humans, LLMs, and other "services" in the chain.

  "messages": [
    {"role": "user", "content": "What is the weather like in Boston?"},
    {"role": "assistant", "content": null, "function_call": {"name": "get_current_weather", "arguments": "{ \"location\": \"Boston, MA\"}"}},
    {"role": "function", "name": "get_current_weather", "content": "{\"temperature\": "22", \"unit\": \"celsius\", \"description\": \"Sunny\"}"}
  ],
Enter fullscreen mode Exit fullscreen mode
  • It's similar to ChatGPT plugins, but it's a universal API that developers can use in their local projects, not just ChatGPT apps.

  • The JSON response is available natively - they have standardised responses and made it so developers don't have to rely on hacks, formatters or extra "prompt engineering"

  • The Function Calling API format will unify the interface and make it easier to refactor "pieces" of software to work between ChatGPT Plugins and custom native environments. Standing things up is a great move!


What are the use cases for the new OpenAI Function Calling?

  • Using a chatbot on your website, you can query your own SQL database or other data source and return the information in a human-like format in specific context.

  • Chat assistants within internal CRM: You ask about what data you want and the assistant creates a "query" on the fly and executes it. You don't need to call anyone or send emails to get that information.

  • Human-like interactive applications on websites using API calls to any "services". For example, a new type of financial calculator could be developed. Instead of sliders, buttons, numbers you just chat with assisted, and he will ask relevant questions based on all your interactions, pack this into a function call and present it to you in the form like you are ten years old, so that everyone can understand it. One of the coolest things about this is that you can change the language in the middle of the sentence from English to Polish, for example, and it will still work.

  • For e-commerce: refining (search, filter, narrow down) search results with a human-like interface instead of buttons and links - you tell what you want!

  • It is possible to create a completely brand new e-commerce interface where you expose Funcion Calls and AI decides from the context of your conversation which function to call from (search, getFavourites, Filter results, Compare items, etc...).


What's next?

With this interface, you can interact with the apps in a conversational manner, without using the mouse pointer for clicking buttons, applying sliders, or scrolling content.

As a result, in the future, apps will be controlled through conversation, which means devices like Alexa will no longer be useless.

In the near future, people will spend less time in front of the screen, and Jarvis-like AI assistants will be available for mobile devices as well as cars like Tesla's


Godspeed

PS. Follow me on Twitter or LinkedIn
https://twitter.com/dom_sipowicz
https://www.linkedin.com/in/dominiksipowicz/

Top comments (0)