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 - Gemini Tutorial
From the course: Gemini API: Tool and Function Calling
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
-
-
-
-
About declaring basic functions5m 1s
-
(Locked)
Declare our first function6m 9s
-
(Locked)
Exploring a function call response3m 19s
-
(Locked)
Initializing our client4m 28s
-
(Locked)
Extracting our function3m 58s
-
(Locked)
Declaring multiple functions3m 56s
-
(Locked)
Querying for a single user4m 21s
-
(Locked)
How function calling modes work3m 20s
-
(Locked)
Using function calling modes11m 39s
-
-
-
-
-