ReportingConfiguration.CachingKeys Property
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.
An optional collection of unique strings that should be hashed when generating the cache keys for cached AI responses.
public:
property System::Collections::Generic::IReadOnlyList<System::String ^> ^ CachingKeys { System::Collections::Generic::IReadOnlyList<System::String ^> ^ get(); };
public System.Collections.Generic.IReadOnlyList<string> CachingKeys { get; }
member this.CachingKeys : System.Collections.Generic.IReadOnlyList<string>
Public ReadOnly Property CachingKeys As IReadOnlyList(Of String)
Property Value
Remarks
If no additional caching keys are supplied, then the cache keys for a cached response are generated based on the content of the AI request that produced this response, metadata such as model name and endpoint present in the configured IChatClient and the ChatOptions that are supplied as part of generating the response.
Additionally, the name of the scenario and the iteration are always included in the cache key. This means that the cached responses for a particular scenario and iteration will not be reused for a different scenario and iteration even if the AI request content and metadata happen to be the same.
Supplying additional caching keys can be useful when some external factors need to be considered when deciding whether a cached AI response is still valid. For example, consider the case where one of the supplied additional caching keys is the version of the AI model being invoked. If the product moves to a newer version of the model, then updating the caching key to reflect this change will cause all cached entries that rely on this caching key to be invalidated thereby ensuring that the subsequent evaluations will not use the outdated cached responses produced by the previous model version.