RunRecordingAgentDecorator
AgentPrism.Core.dllWraps every agent resolved from the catalog with RunRecordingAgent.
public sealed class RunRecordingAgentDecorator : IAgentDecoratorInheritance
Section titled “Inheritance”object ← RunRecordingAgentDecorator
Implements
Section titled “Implements”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”RunRecordingAgentDecorator.Order is 0, so run recording is the outermost wrapper and also measures the time spent by inner wrappers.
Constructors
Section titled “Constructors”RunRecordingAgentDecorator(IRunStore, ITenantContext, IOptions<AgentPrismOptions>, ILogger<RunRecordingAgent>, AgentPrismMetrics?, RunTraceCollector?, TimeProvider?, IRunPricingResolver?, QuotaEnforcer?, IWebhookPublisher?, IRunCancellationRegistry?, IRunErrorClassifier?, IRunInputStore?, RunSampler?, ContentGuardPipeline?, IRunAttributionContext?, IEnumerable<IRunEventSink>?)
Section titled “ RunRecordingAgentDecorator(IRunStore, ITenantContext, IOptions<AgentPrismOptions>, ILogger<RunRecordingAgent>, AgentPrismMetrics?, RunTraceCollector?, TimeProvider?, IRunPricingResolver?, QuotaEnforcer?, IWebhookPublisher?, IRunCancellationRegistry?, IRunErrorClassifier?, IRunInputStore?, RunSampler?, ContentGuardPipeline?, IRunAttributionContext?, IEnumerable<IRunEventSink>?)”Creates a new recording decorator.
public RunRecordingAgentDecorator(IRunStore runStore, ITenantContext tenantContext, IOptions<AgentPrismOptions> options, ILogger<RunRecordingAgent> logger, AgentPrismMetrics? metrics = null, RunTraceCollector? traceCollector = null, TimeProvider? timeProvider = null, IRunPricingResolver? pricingResolver = null, QuotaEnforcer? quotaEnforcer = null, IWebhookPublisher? webhookPublisher = null, IRunCancellationRegistry? cancellationRegistry = null, IRunErrorClassifier? errorClassifier = null, IRunInputStore? runInputStore = null, RunSampler? runSampler = null, ContentGuardPipeline? contentGuardPipeline = null, IRunAttributionContext? attributionContext = null, IEnumerable<IRunEventSink>? sinks = null)Parameters
Section titled “Parameters”runStore IRunStore
The store the events are written to.
tenantContext ITenantContext
The tenant context.
options IOptions<AgentPrismOptions>
The AgentPrism settings.
logger ILogger<RunRecordingAgent>
The logger.
metrics AgentPrismMetrics?
The metric instruments.
traceCollector RunTraceCollector?
The span collector.
timeProvider TimeProvider?
The time source.
pricingResolver IRunPricingResolver?
The cost resolver. If null, cost is not computed.
quotaEnforcer QuotaEnforcer?
The quota accountant. If null, consumption is not counted.
webhookPublisher IWebhookPublisher?
The event publisher. If null, no events are published.
cancellationRegistry IRunCancellationRegistry?
The cancellation registry. If null, the run cannot be canceled from outside.
errorClassifier IRunErrorClassifier?
The error classifier. If null, no error class/fingerprint is computed.
runInputStore IRunInputStore?
The input store. If null, input is not recorded and replay does not work.
runSampler RunSampler?
The online evaluation sampler. If null, no run is sampled.
contentGuardPipeline ContentGuardPipeline?
The content guard pipeline. If null, recorded input is written without inspection. See the note in the RunRecordingAgent constructor.
attributionContext IRunAttributionContext?
The attribution context. If null, the run records no user and no labels.
sinks IEnumerable<IRunEventSink>?
The run event observers. If null or empty, every event
goes to runStore only.
Exceptions
Section titled “Exceptions”One of the required dependencies is null.
Properties
Section titled “Properties”Gets the order of application. A lower value wraps inside, a higher value wraps outside. Run recording uses 0, which makes it the outermost decorator.
public int Order { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Decorate(AIAgent, AgentDescriptor)
Section titled “ Decorate(AIAgent, AgentDescriptor)”Decorates the agent.
public AIAgent Decorate(AIAgent agent, AgentDescriptor descriptor)Parameters
Section titled “Parameters”agent AIAgent
The agent to decorate.
descriptor AgentDescriptor
The catalog summary of the agent.
Returns
Section titled “Returns”AIAgent
The decorated agent.