From the course: Build a Document Search Assistant with Node and OpenAI's Assistants API

Unlock this course with a free trial

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

Integrating function calling

Integrating function calling

- [Instructor] Right now you're going to enhance your assistant by integrating it with an external API using the assistance API function calling feature. We're going to define a function that fetches weather data, implement an in our code and enable the assistant to call the function when appropriate. So function calling. If you read the documents here, you'll learn that it allows the assistant to call functions in your code base, letting it perform actions or fetch data it couldn't otherwise. It provides real time data to users which enhances the assistant's usefulness and it keeps the assistant focused on conversation while your code handles specific tasks. So to demonstrate function calling, I'm going to use the Explore California weather API, which you can check out at explorecalifornia.org. This API is going to give you a fake five day weather forecast for over 7,000 cities around the world. So you can search by the city for instance, here's an example of an endpoint that…

Contents