Microsoft.Extensions.AI.Abstractions 9.5.0

Microsoft.Extensions.AI.Abstractions

.NET developers need to integrate and interact with a growing variety of artificial intelligence (AI) services in their apps. The Microsoft.Extensions.AI libraries provide a unified approach for representing generative AI components, and enable seamless integration and interoperability with various AI services.

The packages

The Microsoft.Extensions.AI.Abstractions package provides the core exchange types, including IChatClient and IEmbeddingGenerator<TInput,TEmbedding>. Any .NET library that provides an LLM client can implement the IChatClient interface to enable seamless integration with consuming code.

The Microsoft.Extensions.AI package has an implicit dependency on the Microsoft.Extensions.AI.Abstractions package. This package enables you to easily integrate components such as automatic function tool invocation, telemetry, and caching into your applications using familiar dependency injection and middleware patterns. For example, it provides the UseOpenTelemetry(ChatClientBuilder, ILoggerFactory, String, Action<OpenTelemetryChatClient>) extension method, which adds OpenTelemetry support to the chat client pipeline.

Which package to reference

Libraries that provide implementations of the abstractions typically reference only Microsoft.Extensions.AI.Abstractions.

To also have access to higher-level utilities for working with generative AI components, reference the Microsoft.Extensions.AI package instead (which itself references Microsoft.Extensions.AI.Abstractions). Most consuming applications and services should reference the Microsoft.Extensions.AI package along with one or more libraries that provide concrete implementations of the abstractions.

Install the package

From the command-line:

dotnet add package Microsoft.Extensions.AI.Abstractions

Or directly in the C# project file:

<ItemGroup>
  <PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="[CURRENTVERSION]" />
</ItemGroup>

Documentation

Refer to the Microsoft.Extensions.AI libraries documentation for more information and API usage examples.

Feedback & Contributing

We welcome feedback and contributions in our GitHub repo.

Showing the top 20 packages that depend on Microsoft.Extensions.AI.Abstractions.

Packages Downloads
Microsoft.SemanticKernel.Abstractions
Semantic Kernel interfaces and abstractions. This package is automatically installed by Semantic Kernel packages if needed.
1

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
9.5.0 1 05/18/2025
9.5.0-preview.1.25262.9 1 05/18/2025
9.4.4-preview.1.25259.16 1 05/18/2025
9.4.3-preview.1.25230.7 0 05/01/2025
9.4.0-preview.1.25207.5 1 04/29/2025
9.3.0-preview.1.25161.3 1 04/29/2025
9.3.0-preview.1.25114.11 1 04/29/2025
9.1.0-preview.1.25064.3 1 04/29/2025
9.0.1-preview.1.24570.5 1 04/29/2025
9.0.0-preview.9.24556.5 1 04/29/2025
9.0.0-preview.9.24525.1 1 05/17/2025
9.0.0-preview.9.24507.7 1 04/29/2025