generative-ai

Gemini SDK for .NET and ASP.NET Core enables developers to use Google's state-of-the-art generative AI models to build AI-powered features and applications.

What is generative-ai?

Gemini SDK for .NET and ASP.NET Core enables developers to use Google's state-of-the-art generative AI models to build AI-powered features and applications.

Overview of generative-ai

What it is

The Gemini SDK for .NET and ASP.NET Core, published as the Mscc.GenerativeAI package on NuGet, enables developers to integrate Google's Gemini API into .NET applications. It supports both Google AI Studio and Vertex AI backends, and is compatible with all Gemini API models and features, including tool usage (code execution, function calling, Google search grounding) and media generation (Imagen).

Key features

  • List available models and get details about a specific model.
  • Generate content from prompts and receive streamed responses.
  • Generate grounded answers using provided context.
  • Generate text embeddings for similarity search.
  • Count tokens in prompts or responses for cost estimation.
  • Start and manage chat sessions for conversational AI.
  • Create tuned models (currently supports text-bison-001 and gemini-2.0-flash-001).

Use cases

Building AI-powered features in .NET and ASP.NET Core applications, such as chatbots, content generation, question answering with grounding, and semantic search. The SDK is suitable for both Google AI (API key or OAuth) and Vertex AI (ADC, OAuth, service account, or Express Mode) authentication scenarios.

Getting started

Install the package from NuGet using the .NET CLI or Package Manager Console:text> dotnet add package Mscc.GenerativeAI``````textPM> Install-Package Mscc.GenerativeAIAfter installation, you can instantiate a model using environment variables (e.g., GOOGLE_API_KEY, GOOGLE_PROJECT_ID) or by explicitly configuring the API and authentication method. See the repository README for full setup details.

License and pricing

Apache-2.0 license. Open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/mscraftsmangenerative-ai.svg)](https://yunodb.com/tools/mscraftsmangenerative-ai?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/mscraftsmangenerative-ai?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/mscraftsmangenerative-ai.svg" alt="Featured on YunoDB" height="20"></a>