IEvaluationCaptureStore
NexusLabs.Needlr.AgentFramework.Evaluation¶
IEvaluationCaptureStore Interface¶
Persists captured Microsoft.Extensions.AI.ChatResponse payloads keyed by a deterministic request hash so that evaluator runs can replay previously observed LLM responses without re-invoking the underlying model.
Derived
↳ FileEvaluationCaptureStore
Remarks¶
Implementations must be safe to call concurrently. Keys are opaque strings produced by EvaluationCaptureChatClient; callers should not construct or parse them directly.
Methods¶
IEvaluationCaptureStore.SaveAsync(string, ChatResponse, CancellationToken) Method¶
Persists response under key. Overwrites any existing entry for the same key.
System.Threading.Tasks.Task SaveAsync(string key, Microsoft.Extensions.AI.ChatResponse response, System.Threading.CancellationToken cancellationToken);
Parameters¶
key System.String
Opaque request hash produced by the capture client.
response Microsoft.Extensions.AI.ChatResponse
The response to persist.
cancellationToken System.Threading.CancellationToken
Cancellation token.
Returns¶
IEvaluationCaptureStore.TryGetAsync(string, CancellationToken) Method¶
Looks up a previously captured response for key.
System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse?> TryGetAsync(string key, System.Threading.CancellationToken cancellationToken);
Parameters¶
key System.String
Opaque request hash produced by the capture client.
cancellationToken System.Threading.CancellationToken
Cancellation token.
Returns¶
System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse>
The cached Microsoft.Extensions.AI.ChatResponse when present, otherwise null.