The GeminiChatExample demonstrates how to integrate Gemini's 2.0-flash model into the framework with minimal setup, showcasing how easy it is to leverage Gemini's capabilities for interactive chat.
public async Task Start()
{
GeminiExample.Setup(); //We need to provide Gemini API key
Console.WriteLine("(Gemini) ChatExample is running!");
await AIHub.Chat()
.WithModel("gemini-2.0-flash")
.WithMessage("Is the killer whale the smartest animal?")
.CompleteAsync(interactive: true);
}- Set up Gemini API β
GeminiExample.Setup()(API key is required) - Initialize a chat session β
AIHub.Chat() - Choose a model β
.WithModel("gemini-2.0-flash") - Send a message β
.WithMessage("Is the killer whale the smartest animal?") - Run the chat β
.CompleteAsync(interactive: true);
This example demonstrates how effortlessly Gemini's 2.0-flash model can be integrated into the framework, enabling seamless interactions with just a few lines of code. The simplicity of setup and ease of use makes it ideal for developers looking to integrate powerful AI capabilities with minimal configuration.