DEV Community

Cover image for Function Calling: The Most Significant AI Feature Since ChatGPT Itself?
Dawid Dahl
Dawid Dahl

Posted on

Function Calling: The Most Significant AI Feature Since ChatGPT Itself?

A few months ago, Umain, the company I work for, organized a hackathon. The goal? To create tech products that harness the power of AI.

umain tech accelerator hackathon

Although the hackathon yielded some promising results, it also revealed a fundamental obstacle stifling further breakthroughs in AI application development: the wide gap between unstructured and structured data.

To better cement the concepts of unstructured and structured data into memory, I will from now on refer to this as Vague-Ass stuff and Hard-Ass stuff.

First, I will clarify what I mean by Vague-Ass and Hard-Ass. Because grasping this dichotomy is crucial for the utility of Function Calling, a brand new feature from OpenAI that addresses all the challenges we faced during the hackathon.

Vague-Ass Stuff

Vague-Ass stuff represents the nebulous, the immeasurable—things that can't be captured in algorithms or databases.

informal emotions

I used a new AI product to expand the image in the middle out to the sides. The result turned out great.

Here, you'll find:

  • Human consciousness
  • Emotions; desires and fears
  • Social norms; cultural nuances
  • The dreams of clients and stakeholders

In this realm, humans communicate using natural language — just everyday conversation.

Hard-Ass Stuff

Conversely, Hard-Ass stuff is the domain governed by rules and structured methodologies.

formal computers and robots

This category includes:

  • Mathematics & Logic
  • Computation
  • Machines

The language of choice here is structured language—code, logic, and equations.

Bridging the Vague-Ass / Hard-Ass Gap (VHG)

Bridging the Vague-Ass / Hard-Ass Gap (VHG for short) has brought some revolutionary improvements for human civilization. It has enabled automation, economic growth, and improved connectivity, making life significantly better.

The point of many professions we have today—such as mathematicians, structural engineers, software developers—is to serve as mediators between these two realms.

In fact, I realized that what we developers actually do all day is transform Vague-Ass stuff into Hard-Ass stuff and then back into Vague-Ass stuff.

Let me show you:

developer workflow

Information flows from the Vague-Ass dimension of unstructured feelings
→ using some kind of form to collect Hard-Ass structured data
→ doing something with that data
→ and then handing it back to the Vague-Ass dimension where some value has hopefully been created, in terms of good feelings.

This is how developers have always worked. And the question we were trying to explore at the hackathon was how to integrate the new and transformative potential of AI into this workflow.

The ChatGPT Challenge: A Dead-End at the VHG

So here I was, presenting our new AI code-smell-detector-app. Yet, something was nagging me: the limitations of using ChatGPT for reliable VHG bridging.

umain hackathon presentation

What does that mean? ChatGPT deals in Vague-Ass stuff using natural language, and therefore it struggles when it attempts to interface with the strictly Hard-Ass stuff that our applications require to function correctly.

Specifically, here is where we as developers are struggling:

  • Collect Hard-Ass structured data with ChatGPT
  • Extract Hard-Ass structured data from ChatGPT

Despite my team and colleagues creating some remarkable prototypes, we were often hamstrung by these limitations. No matter how nicely we asked and pleaded with the AI, it just wouldn't do what we needed it to in order to interact with our apps.

Well, maybe 90% or even 99% of the time it would actually do what we wanted. But when writing software, such odds are often not acceptable.

human and robot struggling to connect

This significantly restricted the potential of every team at the hackathon. And ever since the release of ChatGPT, this has pretty much been the status quo for AI app development.

Until now...

The Artificial Intelligence Bridge

In June 2023, OpenAI suddenly released Function Calling for ChatGPT. What does it do? Basically, it solves every single issue that I have been writing about up to this point.

open-ai function calling bridge

That's why I believe it might be the most significant feature since ChatGPT itself was released. Bridging the gap between Vague-Ass stuff and Hard-Ass stuff means that we will be able to take everything we already excel at as developers, and plug it straight into the promising land of generative AI.

So How Does It Work?

Contrary to what its name suggests, ChatGPT will never actually call your functions. In fact, for Function Calling to work there doesn't even have to be any real functions!

Essentially, all it does is attempt to generate the parameters to hypothetical or potential functions, which you using a JSON schema describe to ChatGPT.

To break it down, this is what is now possible:

  • Convert Vague-Ass natural language into Hard-Ass parameters. Once you have Hard-Ass parameters, you are able to do whatever you want inside your function and return it in whatever way you'd like.
  • Summarize the Hard-Ass data you've generated inside your function back to the user in Vague-Ass natural language
  • Extract Hard-Ass structured data from Vague-Ass ChatGPT computations. By describing exactly what kind of parameters you want (for example, an array of any length with objects), you can reliably return ChatGPT data in your desired format. How? By simply collecting the parameters and returning them.

To explain how Function Calling works using an example, I have made this illustration:

open-ai function calling example

Please excuse the pinecone references, it is an internal joke. Pinecones are not actually an integral part of our corporate structure.

Here or here or is a link to the actual illustration since the image above is too small.

In Conclusion

The advent of Function Calling has some amazing implications for the future of AI apps. It stands as a powerful tool for developers to better serve as the bridge between Hard-Ass stuff and Vague-Ass stuff.

This breakthrough not only addresses existing challenges but also opens new avenues for innovative applications.

Dawid Dahl is a full-stack developer at UMAINARC. In his free time, he enjoys philosophy, analog synthesizers, consciousness, and being with friends and family.

Top comments (2)

marika_37 profile image
Marika Höglund


timetoquite profile image

More stuff like this! Well done Dawid