How to Make Chat GPT Smarter with Function Call: Part 2

How to Make Chat GPT Smarter with Function Call: Part 2

In the previous episode How to Make ChatGPT Smarter: Part 1, we discussed how to make Chat GPT smarter using RAG (Retrieval Augmented Generation) and Agentic AI. Now, we will talk about the Function Call feature of Chat GPT.

The use of Function Calling is generally less popular than the first two methods because it requires the ability to write code in various languages, such as Python, to create functions for the AI to choose from.

First, we need to understand what a function is. The W3S (Python Functions) website defines it as follows:

  • A function is a block of code which only runs when it is called. – A function will only run when we call it.
  • You can pass data, known as parameters, into a function. – We can pass data (known as parameters) into the function.
  • A function can return data as a result. – And the function can return data as a result.

For example:

				
					def my_function(country):
print("I am from " + country)
my_function("Thailand")
				
			

In this function, it instructs to print the phrase “I am from” followed by whatever word is provided. If we input “Thailand,” it will output “I am from Thailand.”

Since Chat GPT 3.5, when we call through the API, whether it’s via the Open AI API or Azure Open AI, How to use Azure OpenAI we can have “it” call the functions we have previously written.

For example, we use Chat GPT as Customer Service, and we want Chat GPT to be able to check if the customer’s product number has been delivered. We can have it pull this function into the response, as shown in the example below.

The Function Call itself will enhance the development of various applications using the Open AI API, making them more efficient and comprehensive.

Furthermore, by combining Agentic AI, RAG, and Functional approaches, we might be able to develop even more advanced AI. For example, we could create three AIs where the first one is RAG, which selects the appropriate function for us from the documentation, then calls the necessary function, and reviews the answer before outputting it.

Planning for AI to work effectively with other AIs and with humans is one of the main goals of Data Alchemist What Does an AI Alchemist Do?. If you need to consult with an AI Alchemist, you can contact us via Line at @davoy

Subscribe to get great articles about data

[hubspot type=”form” portal=”47406981″ id=”244b28eb-5322-4f57-80ff-1745ac75313c”]

Reference:

Chat Widget - Davoy.tech