From the course: Build with AI: Building a Project with the ChatGPT API

Unlock this course with a free trial

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

Integrate tools using function calling

Integrate tools using function calling

- [Narrator] Your agent may be smart, but on its own, it's limited to the knowledge it was trained on. If you want it to look up real time weather, send a Slack message or fetch a list of tasks from your project management app, you'll need to give it tools. Agents get smarter when they can use tools like calling your own code, searching the web reading files, controlling your browser, or even executing commands on your local machine. For this course, we'll focus on calling your own code using function calling. What is Function Calling? Function Calling enables your agent to understand when a task requires an external action, automatically format input arguments based on the user's request, and trigger the appropriate function in your application code. You define the available tools and the model decides when and how to call them. Let's say you want to connect your agent to a real-time asteroid data API. Instead of writing a prompt like, "Tell me how many asteroids are headed toward…

Contents