PurviewExtensions.PurviewChatMiddleware Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a Purview middleware function for use with a IChatClient.
public static Func<Microsoft.Extensions.AI.IChatClient,Microsoft.Extensions.AI.IChatClient> PurviewChatMiddleware(Azure.Core.TokenCredential tokenCredential, Microsoft.Agents.AI.Purview.PurviewSettings purviewSettings, Microsoft.Extensions.Logging.ILogger? logger = default, Microsoft.Extensions.Caching.Distributed.IDistributedCache? cache = default);
static member PurviewChatMiddleware : Azure.Core.TokenCredential * Microsoft.Agents.AI.Purview.PurviewSettings * Microsoft.Extensions.Logging.ILogger * Microsoft.Extensions.Caching.Distributed.IDistributedCache -> Func<Microsoft.Extensions.AI.IChatClient, Microsoft.Extensions.AI.IChatClient>
Public Function PurviewChatMiddleware (tokenCredential As TokenCredential, purviewSettings As PurviewSettings, Optional logger As ILogger = Nothing, Optional cache As IDistributedCache = Nothing) As Func(Of IChatClient, IChatClient)
Parameters
- tokenCredential
- TokenCredential
The token credential used to authenticate with Purview.
- purviewSettings
- PurviewSettings
The settings for communication with Purview.
- logger
- ILogger
The logger to use for logging.
- cache
- IDistributedCache
The distributed cache to use for caching Purview responses. An in memory cache will be used if this is null.
Returns
A chat middleware delegate.