From the course: OpenAI API for Python Developers

Introduction to OpenAI function calling

From the course: OpenAI API for Python Developers

Introduction to OpenAI function calling

- [Instructor] So far, what we've been doing is to successfully integrate the OpenAIs APIs within our applications to create agents powered by artificial intelligence. So we can interact with these agents in a natural fashions to perform various text processing tasks, like generating images, convert audio to text, translate audio samples, and even process codes. So let's make a quick demonstration with this helpful assistance. So I'm going to ask a basic math questions like what is two and two? And here, naturally we're going to see that the answer is, let's wait for it. Two and two equals four, excellence. So now I'm going to ask another type of question, which is What time is it? (typing on keyboard) And here it's going to apologize to us by saying that I am sorry, but I don't have access to real-time information. And I could have asked another questions like, What is the weather forecasts, for example? So this is something to keep in mind. Large language models are trained on millions of data. However, the limitation is that the models are trained up to a certain date. So we can check here the list of available language models and we're going to see that we have a training data date. So for example, for the latest language models available, the trainee data is up to the date of April, 2023. And if we check below, we're going to have here the information for the GPT-3 0.5 turbo models. And here the trading data is up to September, 2021. So this is something to keep in mind. So any event or any information past this date is not going to show in the results. In this module, we're going to discover the function calling feature. With function calling, we can give the large language model the ability to fetch external and current data from public APIs or your own backend APIs. So what we want to do in this module is to create an AI powered agents. And to take it a step further, we want to allow the chat models to call external APIs to generate extended responses and allow it to provide with an enhanced user experience. So we're going to equip the AI agents with the ability to expand its knowledge and capacities. So up next we want to create an AI powered chat bot that understands natural language to answer user queries and which is also capable of giving the current weather reports.

Contents