From the course: Gemini API: Tool and Function Calling

Unlock this course with a free trial

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

Using function calling modes

Using function calling modes

- [Narrator] Here in VS Code, we have a Python file that already contains some function-calling code. In this code, we have a function declared that returns the time of the day based on a given time zone. We have set it up as a tool to be used in our request configuration. This is our starting point, and we'll be testing out this function with the three function-calling modes, starting with auto. Because I'll be updating this code file, I have also provided a start version that you can use to start in order to follow along with the example. You can find it in the exercise files in the chapter 2 folder with the name calling-modes-start.py. Let's close out of this, and return to our main file. As I said, we're going to start this demo by testing out the auto mode. First, I'm going to write my prompt and function-calling mode as variables. This will allow us to switch them based on the mode we're currently using.…

Contents