diff --git a/docs/ai/microsoft-extensions-ai.md b/docs/ai/microsoft-extensions-ai.md index 3a8b236ad892d..e0d1e9427e276 100644 --- a/docs/ai/microsoft-extensions-ai.md +++ b/docs/ai/microsoft-extensions-ai.md @@ -40,6 +40,8 @@ The following subsections show specific [`IChatClient`](#the-ichatclient-interfa - [Custom `IChatClient` middleware](#custom-ichatclient-middleware) - [Dependency injection](#dependency-injection) - [Stateless vs. stateful clients](#stateless-vs-stateful-clients) +- [Chat reduction (experimental)](#chat-reduction-experimental) +- [Tool reduction (experimental)](#tool-reduction-experimental) The following sections show specific [`IEmbeddingGenerator`](#the-iembeddinggenerator-interface) usage examples: @@ -198,6 +200,20 @@ If you don't know ahead of time whether the service is stateless or stateful, yo :::code language="csharp" source="snippets/microsoft-extensions-ai/ConsoleAI.StatelessStateful/Program.cs" id="Snippet4"::: +#### Chat reduction (experimental) + +> [!IMPORTANT] +> This feature is experimental and subject to change. + +Chat reduction helps manage conversation history by limiting the number of messages or summarizing older messages when the conversation exceeds a specified length. The `Microsoft.Extensions.AI` library provides reducers like that limits the number of non-system messages, and that automatically summarizes older messages while preserving context. + +#### Tool reduction (experimental) + +> [!IMPORTANT] +> This feature is experimental and subject to change. + +Tool reduction helps manage large tool catalogs by trimming them based on relevance to the current conversation context. The interface defines strategies for reducing the number of tools sent to the model. The library provides implementations like that ranks tools by embedding similarity to the conversation. Use the extension method to add tool reduction to your chat client pipeline. + ### The `IEmbeddingGenerator` interface The interface represents a generic generator of embeddings. For the generic type parameters, `TInput` is the type of input values being embedded, and `TEmbedding` is the type of generated embedding, which inherits from the class.