https://github.com/mun1z/generative-ai-dotnet
About DotNet client library for Google's large language model PaLM API
https://github.com/mun1z/generative-ai-dotnet
client csharp dotnet gemini generative google ia
Last synced: about 1 month ago
JSON representation
About DotNet client library for Google's large language model PaLM API
- Host: GitHub
- URL: https://github.com/mun1z/generative-ai-dotnet
- Owner: MUN1Z
- License: mit
- Created: 2023-12-15T14:11:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T17:02:49.000Z (over 2 years ago)
- Last Synced: 2025-10-09T10:53:48.971Z (9 months ago)
- Topics: client, csharp, dotnet, gemini, generative, google, ia
- Language: C#
- Homepage: https://developers.generativeai.google
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Google AI DotNet SDK
[](https://opensource.org/licenses/MIT)
[](https://discord.gg/cjxa6bjD)
[](https://github.com/mun1z/generative-ai-dotnet/stargazers)
For example, with just a few lines of code, you can access Gemini's multimodal capabilities to generate text from text input:
```C#
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`
1. [Obtain an API key](https://makersuite.google.com/app/apikey) to use with the Google AI SDKs.
1. Open and build the solution(.sln) file of this repo.
1. Paste your API key into the `YOUR_API_KEY` property in the `Program` file.
1. Run the app, put a your text input in console and click enter.
https://github.com/MUN1Z/generative-ai-dotnet/assets/17263249/2e9bc946-de08-4469-a255-eac03005a0e4
## Documentation
Find complete documentation for the Google AI SDKs and the Gemini model in the Google documentation:\
https://ai.google.dev/docs