From the course: Azure AI for Developers: Building AI Agents

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Function calling

Function calling

- [Instructor] Let's start with function calling. We will create a travel agent assistant that helps our travel agency answer customer queries. This notebook guides you through each step. We first need to create an environment file that contains the needed Azure OpenAI parameters, and we then load the Azure configurations in our notebook. We then define our functions. In our example, we will have three functions. The first function provides the countries that our travel agency services. The second function provides the travel budget for each country. The third function provides weather for each country. The first two functions, as you can see, does not require a parameter, while the weather function requires a country parameter. These are the JSON definitions of the functions. We then need to create the functions using Python. For now, we hardcoded the values, but imagine that you will call other external APIs to extract the needed values. The first and second function may call an API…

Contents