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.

Initializing our client

Initializing our client

- [Instructor] So now that we have our tool set up, let us initialize our clients. I'm going to say client = genai.client. So we have our client and we have our tools. Now, how do we pass our tools to our client? This can be done by passing the tool to our generation configuration. So, that's the next thing we're going to be doing. We're going to create a configuration and a generation configuration is created using the generate config class, GenerateContentConfig class. So now, generate config class, GenerateContentConfig class from the types model. So, inside this class, we can then pass our tools as a list into the tools argument. So, I'm just going to pass this tools. Yeah, and this is because you might want to pass other tools, like for example, the grounding with Google search tool that we're going to be seeing later. But for now, we're just going to pass in the tools that come from our function declarations.…

Contents