Skip to content

Commit a9776a3

Browse files
Merge pull request #44950 from dotnet/main
Merge main into live
2 parents 8aff703 + ec7cca7 commit a9776a3

File tree

62 files changed

+1420
-1091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1420
-1091
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -789,17 +789,6 @@ updates:
789789
dotnet:
790790
patterns:
791791
- "*" # Prefer a single PR per project update.
792-
- package-ecosystem: "nuget"
793-
directory: "/docs/ai/how-to/snippets/semantic-kernel" #semantic-kernel.csproj
794-
schedule:
795-
interval: "weekly"
796-
day: "wednesday"
797-
open-pull-requests-limit: 5
798-
groups:
799-
# Group .NET updates together for projects.
800-
dotnet:
801-
patterns:
802-
- "*" # Prefer a single PR per project update.
803792
- package-ecosystem: "nuget"
804793
directory: "/docs/ai/quickstarts/snippets/assistants" #AIAssistants.csproj
805794
schedule:
@@ -2197,3 +2186,14 @@ updates:
21972186
dotnet:
21982187
patterns:
21992188
- "*" # Prefer a single PR per project update.
2189+
- package-ecosystem: "nuget"
2190+
directory: "/docs/devops/snippets/create-dotnet-github-action/DotNet.GitHubAction" #DotNet.GitHubAction.csproj
2191+
schedule:
2192+
interval: "weekly"
2193+
day: "wednesday"
2194+
open-pull-requests-limit: 5
2195+
groups:
2196+
# Group .NET updates together for projects.
2197+
dotnet:
2198+
patterns:
2199+
- "*" # Prefer a single PR per project update.

.github/workflows/profanity-filter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Profanity filter
2727
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }}
28-
uses: IEvangelist/profanity-filter@856d4ea30f1889cf9bbca70604358d78c543df70 # main
28+
uses: IEvangelist/profanity-filter@197ef76452b19a7b5b737fffa3e9f5a1472b5df8 # main
2929
id: profanity-filter
3030
with:
3131
token: ${{ secrets.GITHUB_TOKEN }}

docs/ai/ai-extensions.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ ms.author: alexwolf
1010

1111
# Unified AI building blocks for .NET using Microsoft.Extensions.AI
1212

13-
The .NET ecosystem provides abstractions for integrating AI services into .NET applications and libraries using the <xref:Microsoft.Extensions.AI> and [`Microsoft.Extensions.AI.Abstractions`](https://www.nuget.org/packages/Microsoft.Extensions.AI.Abstractions) libraries. The .NET team also enhanced the core `Microsoft.Extensions.*` libraries with these abstractions for .NET generative AI applications and libraries. In the sections ahead, you learn:
13+
The .NET ecosystem provides abstractions for integrating AI services into .NET applications and libraries using the <xref:Microsoft.Extensions.AI> libraries. The .NET team has also enhanced the core `Microsoft.Extensions` libraries with these abstractions for use in generative AI .NET applications and libraries. In the sections ahead, you learn:
1414

1515
- Core concepts and capabilities of the `Microsoft.Extensions.AI` libraries.
1616
- How to work with AI abstractions in your apps and the benefits they offer.
1717
- Essential AI middleware concepts.
1818

1919
For more information, see [Introduction to Microsoft.Extensions.AI](../core/extensions/artificial-intelligence.md).
2020

21-
## What is the Microsoft.Extensions.AI library?
21+
## What are the Microsoft.Extensions.AI libraries?
2222

23-
<xref:Microsoft.Extensions.AI> is a set of core .NET libraries created in collaboration with developers across the .NET ecosystem, including Semantic Kernel. These libraries provide a unified layer of C# abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs), embeddings, and middleware.
23+
The `Microsoft.Extensions.AI` libraries provides core exchange types and abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs). They also provide the ability to register services like logging and caching in your dependency injection (DI) container.
2424

2525
:::image type="content" source="media/ai-extensions/meai-architecture-diagram.png" lightbox="media/ai-extensions/meai-architecture-diagram.png" alt-text="An architectural diagram of the AI extensions libraries.":::
2626

27-
`Microsoft.Extensions.AI` provides abstractions that can be implemented by various services, all adhering to the same core concepts. This library is not intended to provide APIs tailored to any specific provider's services. The goal of `Microsoft.Extensions.AI` is to act as a unifying layer within the .NET ecosystem, enabling developers to choose their preferred frameworks and libraries while ensuring seamless integration and collaboration across the ecosystem.
27+
The `Microsoft.Extensions.AI` namespaces provide abstractions that can be implemented by various services, all adhering to the same core concepts. This library is not intended to provide APIs tailored to any specific provider's services. The goal of `Microsoft.Extensions.AI` is to act as a unifying layer within the .NET ecosystem, enabling developers to choose their preferred frameworks and libraries while ensuring seamless integration and collaboration across the ecosystem.
2828

2929
## Work with abstractions for common AI services
3030

@@ -34,9 +34,9 @@ AI capabilities are rapidly evolving, with patterns emerging for common function
3434
- Embedding generation to integrate with vector search capabilities.
3535
- Tool calling to integrate with other services, platforms, or code.
3636

37-
The `Microsoft.Extensions.AI` library provides abstractions for these types of tasks, so developers can focus on coding against conceptual AI capabilities rather than specific platforms or provider implementations. Unified abstractions are crucial for developers to work effectively across different sources.
37+
The `Microsoft.Extensions.AI.Abstractions` package provides abstractions for these types of tasks, so developers can focus on coding against conceptual AI capabilities rather than specific platforms or provider implementations. Unified abstractions are crucial for developers to work effectively across different sources.
3838

39-
For example, the `IChatClient` interface allows consumption of language models from various providers, whether you're connecting to an Azure OpenAI service or running a local Ollama installation. Any .NET package that provides an AI client can implement the `IChatClient` interface, enabling seamless integration with consuming .NET code:
39+
For example, the <xref:Microsoft.Extensions.AI.IChatClient> interface allows consumption of language models from various providers, such as an Azure OpenAI service or a local Ollama installation. Any .NET package that provides an AI client can implement the `IChatClient` interface to enable seamless integration with consuming .NET code:
4040

4141
```csharp
4242
IChatClient client =
@@ -45,7 +45,7 @@ IChatClient client =
4545
    new AzureAIInferenceChatClient(...);
4646
```
4747

48-
Then, regardless of the provider you're using, you can send requests as follows:
48+
Then, regardless of the provider you're using, you can send requests by calling <xref:Microsoft.Extensions.AI.IChatClient.CompleteAsync(System.Collections.Generic.IList{Microsoft.Extensions.AI.ChatMessage},Microsoft.Extensions.AI.ChatOptions,System.Threading.CancellationToken)>, as follows:
4949

5050
```csharp
5151
var response = await chatClient.CompleteAsync(
@@ -54,7 +54,7 @@ var response = await chatClient.CompleteAsync(
5454
Console.WriteLine(response.Message);
5555
```
5656

57-
These abstractions allow for idiomatic C# code for various scenarios with minimal code changes, whether you're using different services for development and production, addressing hybrid scenarios, or exploring other service providers.
57+
These abstractions allow for idiomatic C# code for various scenarios with minimal code changes. They make it easy to use different services for development and production, addressing hybrid scenarios, or exploring other service providers.
5858

5959
Library authors who implement these abstractions make their clients interoperable with the broader `Microsoft.Extensions.AI` ecosystem. Service-specific APIs remain accessible if needed, allowing consumers to code against the standard abstractions and pass through to proprietary APIs only when required.
6060

@@ -69,9 +69,9 @@ In the future, implementations of these `Microsoft.Extensions.AI` abstractions w
6969

7070
## Middleware implementations for AI services
7171

72-
Connecting to and using AI services is just one aspect of building robust applications. Production-ready applications require additional features like telemetry, logging, and tool-calling capabilities. The `Microsoft.Extensions.AI` abstractions enable you to easily integrate these components into your applications using familiar patterns.
72+
Connecting to and using AI services is just one aspect of building robust applications. Production-ready applications require additional features like telemetry, logging, caching, and tool-calling capabilities. The `Microsoft.Extensions.AI` packages provides APIs that enable you to easily integrate these components into your applications using familiar dependency injection and middleware patterns.
7373

74-
The following sample demonstrates how to register an OpenAI `IChatClient`. `IChatClient` allows you to attach the capabilities in a consistent way across various providers.
74+
The following sample demonstrates how to register an OpenAI `IChatClient`. You can attach capabilities in a consistent way across various providers by calling methods such as <xref:Microsoft.Extensions.AI.FunctionInvokingChatClientBuilderExtensions.UseFunctionInvocation(Microsoft.Extensions.AI.ChatClientBuilder,Microsoft.Extensions.Logging.ILoggerFactory,System.Action{Microsoft.Extensions.AI.FunctionInvokingChatClient})> on a <xref:Microsoft.Extensions.AI.ChatClientBuilder>.
7575

7676
```csharp
7777
app.Services.AddChatClient(builder => builder
@@ -82,16 +82,16 @@ app.Services.AddChatClient(builder => builder
8282
    .Use(new OpenAIClient(...)).AsChatClient(...));
8383
```
8484

85-
The capabilities demonstrated in this snippet are included in the `Microsoft.Extensions.AI` library, but they are only a small subset of the capabilities that can be layered in with this approach. .NET developers are able to expose many types of middleware to create powerful AI functionality.
85+
The capabilities demonstrated in this snippet are included in the `Microsoft.Extensions.AI` library, but they're only a small subset of the capabilities that can be layered in with this approach. .NET developers are able to expose many types of middleware to create powerful AI functionality.
8686

8787
## Build with Microsoft.Extensions.AI
8888

8989
You can start building with `Microsoft.Extensions.AI` in the following ways:
9090

91-
- **Library Developers**: If you own libraries that provide clients for AI services, consider implementing the interfaces in your libraries. This allows users to easily integrate your NuGet package via the abstractions.
92-
- **Service Consumers**: If you're developing libraries that consume AI services, use the abstractions instead of hardcoding to a specific AI service. This approach gives your consumers the flexibility to choose their preferred service.
93-
- **Application Developers**: Use the abstractions to simplify integration into your apps. This enables portability across models and services, facilitates testing and mocking, leverages middleware provided by the ecosystem, and maintains a consistent API throughout your app, even if you use different services in different parts of your application.
94-
- **Ecosystem Contributors**: If you're interested in contributing to the ecosystem, consider writing custom middleware components.
91+
- **Library developers**: If you own libraries that provide clients for AI services, consider implementing the interfaces in your libraries. This allows users to easily integrate your NuGet package via the abstractions.
92+
- **Service consumers**: If you're developing libraries that consume AI services, use the abstractions instead of hardcoding to a specific AI service. This approach gives your consumers the flexibility to choose their preferred service.
93+
- **Application developers**: Use the abstractions to simplify integration into your apps. This enables portability across models and services, facilitates testing and mocking, leverages middleware provided by the ecosystem, and maintains a consistent API throughout your app, even if you use different services in different parts of your application.
94+
- **Ecosystem contributors**: If you're interested in contributing to the ecosystem, consider writing custom middleware components.
9595

9696
To get started, see the samples in the [dotnet/ai-samples](https://aka.ms/meai-samples) GitHub repository.
9797

0 commit comments

Comments
 (0)