DiskBasedResponseCacheProvider(String, Nullable<TimeSpan>) Constructor

Definition

An IEvaluationResponseCacheProvider that returns an IDistributedCache that can cache AI responses for a particular ScenarioRun under the specified storageRootPath on disk.

public DiskBasedResponseCacheProvider(string storageRootPath, TimeSpan? timeToLiveForCacheEntries = default);
new Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCacheProvider : string * Nullable<TimeSpan> -> Microsoft.Extensions.AI.Evaluation.Reporting.Storage.DiskBasedResponseCacheProvider
Public Sub New (storageRootPath As String, Optional timeToLiveForCacheEntries As Nullable(Of TimeSpan) = Nothing)

Parameters

storageRootPath
String

The path to a directory on disk under which the cached AI responses should be stored.

timeToLiveForCacheEntries
Nullable<TimeSpan>

An optional TimeSpan that specifies the maximum amount of time that cached AI responses should survive in the cache before they are considered expired and evicted.

Applies to