Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.59 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.59 KB

Google AI DotNet SDK

License: MIT Discord GitHub stars

For example, with just a few lines of code, you can access Gemini's multimodal capabilities to generate text from text input:

using GoogleGenerativeAI;

var gen = new GenerativeAIService("YOUR_API_KEY");
var response = await gen.GenerateContentAsync("");
var firstPart =  response.Candidates.FirstOrDefault().Content.Parts.FirstOrDefault();

Console.WriteLine(firstPart.Text);

Try out the sample Dotnet console app

This repository contains a sample app demonstrating how the SDK can access and utilize the Gemini model for various use cases.

  1. Check out this repository.
    git clone https://github.com/muniz/generative-ai-dotnet

  2. Obtain an API key to use with the Google AI SDKs.

  3. Open and build the solution(.sln) file of this repo.

  4. Paste your API key into the YOUR_API_KEY property in the Program file.

  5. Run the app, put a your text input in console and click enter.

5ac78a46d0fd371fe98656b13d22c083.mp4

Documentation

Find complete documentation for the Google AI SDKs and the Gemini model in the Google documentation:
https://ai.google.dev/docs