In October 2024, Microsoft announced the Microsoft.Extensions.AI.Abstractions and Microsoft.Extensions.AI libraries for .NET. These libraries provide the .NET ecosystem with essential abstractions for integrating AI services into .NET applications from various providers such as Open AI, Azure, Google.
Today, we’re happy to announce the Google.Cloud.VertexAI.Extensions library. This is the Vertex AI implementation of Microsoft.Extensions.AI. This library enables .NET developers to integrate Google Gemini models on Vertex AI via the Microsoft.Extensions.AI abstractions.
Note: This library is currently in pre-release/beta pending user feedback. Please reach out with any feedback you might have.
Core benefits
-
Unified API: Delivers a consistent set of APIs and conventions for integrating AI services into .NET applications.
-
Flexibility: Allows .NET library authors to use AI services without being tied to a specific provider, making it adaptable to any provider.
-
Ease of Use: Enables .NET developers to experiment with different packages using the same underlying abstractions, maintaining a single API throughout their application.
APIs and functionality
There are three core interfaces:
-
The
IChatClientinterface defines a client abstraction responsible for interacting with AI services that provide chat capabilities. -
The
IEmbeddingGeneratorinterface represents a generic generator of embeddings. -
The
IImageGeneratorinterface (experimental) represents a generator for creating images from text prompts or other input.
What’s the Google.Cloud.VertexAI.Extensions library?
The Microsoft.Extensions.AI library supports providers like OpenAI, Azure, and Ollama. The Google.Cloud.VertexAI.Extensions library is the Vertex AI implementation of Microsoft.Extensions.AI. It enables .NET developers to integrate with Google’s Gemini on Vertex AI via the Microsoft.Extensions.AI abstractions.
What about the Google Gen AI .NET SDK?
At this point, you might be wondering: Doesn’t Google already have a .NET SDK for Gemini?
You’re right. There’s the Google Gen AI .NET SDK that we announced back in October 2025. Developers building applications that will only use Google as an AI provider should continue to use the Google Gen AI .NET SDK. Developers building applications that may use different AI providers (Google, OpenAI, Azure …) will benefit from the Google.Cloud.VertexAI.Extensions library.
Samples
Now that we understand the context, let’s take a look at some samples.
Microsoft.Extensions.AI with Ollama
Before we look into Google.Cloud.VertexAI.Extensions, let’s actually look at the hello world chat sample with Ollama.
Let’s take a look at the details.
What’s the Microsoft.Extension.AI library?
Microsoft.Extensions.AI is a set of core .NET libraries that provide a unified layer of C# abstractions for interacting with AI services from different providers such as OpenAI, Azure AI Inference, Ollama.
Source Credit: https://cloud.google.com/blog/topics/developers-practitioners/introducing-google-cloud-vertex-ai-extensions-for-net/
