Interface IRequestCache
- Namespace
- IntentSharp.Resilience
- Assembly
- IntentSharp.dll
Caches provider responses by request content so identical requests do not call the model twice.
public interface IRequestCache
- Extension Methods
Methods
- ClearAsync(CancellationToken)
Removes every entry.
- GetAsync(string, CancellationToken)
Returns the response stored under
key, or null when there is none or it has expired.
- GetStats()
Returns the hit, miss and entry counts.
- SetAsync(string, AIResponse, TimeSpan, CancellationToken)
Stores
responseunderkeyforttl, replacing any entry with the same key.