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.

Implementing a single-turn function call flow

Implementing a single-turn function call flow - Gemini Tutorial

From the course: Gemini API: Tool and Function Calling

Implementing a single-turn function call flow

- [Narrator] With an understanding of how single-turn function calling works at hand, let's see it in action. Here in VS Code, we have a function-calling demo that contains a function that validates an email. We have the function declaration that will be passed to our model and the actual function that is going to perform the operation. The client has also been set up with the function declaration as a tool, and we have two prompts that we can use to test out the function. One with a valid email and another with an invalid email. The code to extract and also call the function is also in place. All of this, we are already familiar with. The code we'll be writing to complete this function is the final step, where the result of the function is returned to the model for a final response. The model will take our function's results and process it to deliver a user-friendly response to the user of our application. Let's…

Contents