> dotnet add package GeminiChat.DotNet
Package Manager:
PM > Install-Package GeminiChat.DotNet
- Your API Key for Gemini. You can get it from here.
- Install this package on your project with CLI or Nuget Package Manager.
Sample Code:
var service = new GeminiService("INPUT YOUR API KEY");
gemini.AppendMessage("Hi!");
var answer = await gemini.GetResponseAsync();
gemini.AppendMessage("Write a story about magic pack.");
var story = string.Empty;
await gemini.StreamResponseAsync((dataLine) =>
{
story += dataLine;
});
Pull requests are welcome to improve this library.