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.

Calling multiple functions in parallel

Calling multiple functions in parallel - Gemini Tutorial

From the course: Gemini API: Tool and Function Calling

Calling multiple functions in parallel

- [Instructor] In this parallel function calling demo, we'll be writing a simple application that will call three independent functions in parallel. One function that gets the current temperature in a city, another function that gets the time zone of a specific city, and the third function that gets the population of a given city. Let's begin. First, let us create a new file in our chapter three folder for our new demo. Could call this file parallel-function-calling.py. Now, inside this file, let us bring in our dependencies. So put this aside. Say, from google import genai and from google.genai import types. Good. Now let us bring in our functions. First, let us bring in the temperature function. So just get go and grab the temperature function from our exercise files. The temperature function takes a city, will document it, and it would use this mock temperature data to return the temperature details for a specific city.…

Contents