Skip to content

shaka0919/GeminiChat.DotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuget NuGet

Installlation

> dotnet add package GeminiChat.DotNet

Package Manager:

PM > Install-Package GeminiChat.DotNet

Getting Started

  1. Your API Key for Gemini. You can get it from here.
  2. 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.