Table of Contents

This example shows how to use GeminiChatAgent to make function call. This example is modified from gemini-api function call example

To run this example, you need to have a project on Google Cloud with access to Vertex AI API. For more information please refer to Google Vertex AI.

Note

You can find the complete sample code here

Step 1: Install AutoGen.Gemini and AutoGen.SourceGenerator

First, install the AutoGen.Gemini package using the following command:

dotnet add package AutoGen.Gemini
dotnet add package AutoGen.SourceGenerator

The AutoGen.SourceGenerator package is required to generate the FunctionContract. For more information, please refer to Create-type-safe-function-call

Step 2: Add using statement

Warning

It looks like the sample you are looking for does not exist.

Step 3: Create MovieFunction

Warning

It looks like the sample you are looking for does not exist.

Step 4: Create a Gemini agent

Warning

It looks like the sample you are looking for does not exist.

Step 5: Single turn function call

Warning

It looks like the sample you are looking for does not exist.

Step 6: Multi-turn function call

Warning

It looks like the sample you are looking for does not exist.