RunSampler
AgentPrism.Core.dllDecides whether to sample a completed run for online evaluation and, when sampled, queues a JobKind.OnlineEval job.
public sealed class RunSamplerInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”This class only writes to the queue. The actual judge call, which spends money, runs in the background through OnlineEvalJobHandler. Like WebhookPublisher, it slows the main run path only by a fast queue write, so a slow or unreachable judge has no impact.
RunRecordingAgent wraps this call in try/catch. A sampling
failure does not affect the run, as required by the observability rule.
Constructors
Section titled “Constructors”RunSampler(IJobStore, IOptionsMonitor<OnlineEvaluationOptions>, TimeProvider?, ILogger<RunSampler>?)
Section titled “ RunSampler(IJobStore, IOptionsMonitor<OnlineEvaluationOptions>, TimeProvider?, ILogger<RunSampler>?)”Decides whether to sample a completed run for online evaluation and, when sampled, queues a JobKind.OnlineEval job.
public RunSampler(IJobStore jobStore, IOptionsMonitor<OnlineEvaluationOptions> optionsMonitor, TimeProvider? timeProvider = null, ILogger<RunSampler>? logger = null)Parameters
Section titled “Parameters”jobStore IJobStore
optionsMonitor IOptionsMonitor<OnlineEvaluationOptions>
timeProvider TimeProvider?
logger ILogger<RunSampler>?
Remarks
Section titled “Remarks”This class only writes to the queue. The actual judge call, which spends money, runs in the background through OnlineEvalJobHandler. Like WebhookPublisher, it slows the main run path only by a fast queue write, so a slow or unreachable judge has no impact.
RunRecordingAgent wraps this call in try/catch. A sampling
failure does not affect the run, as required by the observability rule.
Methods
Section titled “Methods”SampleAsync(RunSampleRequest, CancellationToken)
Section titled “ SampleAsync(RunSampleRequest, CancellationToken)”Evaluates a run for sampling and queues it when required.
public ValueTask<bool> SampleAsync(RunSampleRequest request, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”request RunSampleRequest
The summary of the run to sample.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true when a job was queued.