Skip to content

RunReplayService

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Makes a recorded run re-runnable with the same input under modified conditions.

public sealed class RunReplayService

objectRunReplayService

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The service does not start the run; it only prepares it. This lets the caller use the same plan on a streaming, non-streaming, or queued path, and every failure condition is known before the response starts.

Replay is sessionless. If the source run belongs to a session, its input is only the messages from that turn; history is injected by ChatHistoryProvider and is not part of the recorded input. Running the replay in the same session would write into the source’s conversation (append-only); that is why a replay is always a new, sessionless run. To restart a multi-turn conversation from the beginning, use branching (IConversationBranchStore).

RunReplayService(IRunStore, IRunInputStore, IAgentDefinitionStore, IAgentCatalog, AgentDefinitionCompiler, IToolRegistry, IEnumerable<IAgentDecorator>, ITenantContext)

Section titled “ RunReplayService(IRunStore, IRunInputStore, IAgentDefinitionStore, IAgentCatalog, AgentDefinitionCompiler, IToolRegistry, IEnumerable<IAgentDecorator>, ITenantContext)”

Creates a new replay service.

public RunReplayService(IRunStore runs, IRunInputStore inputs, IAgentDefinitionStore definitions, IAgentCatalog catalog, AgentDefinitionCompiler compiler, IToolRegistry tools, IEnumerable<IAgentDecorator> decorators, ITenantContext tenantContext)

runs IRunStore

The run store.

inputs IRunInputStore

The input store.

definitions IAgentDefinitionStore

The agent definition store.

catalog IAgentCatalog

The agent catalog.

compiler AgentDefinitionCompiler

The definition compiler.

tools IToolRegistry

The tool registry. The approval-required tool check is read from here.

decorators IEnumerable<IAgentDecorator>

The wrappers to apply to the resolved agent.

tenantContext ITenantContext

The tenant context.

ArgumentNullException

One of the dependencies is null.

PrepareAsync(Guid, RunReplayRequest, CancellationToken)

Section titled “ PrepareAsync(Guid, RunReplayRequest, CancellationToken)”

Prepares a replay.

public ValueTask<RunReplayPreparation> PrepareAsync(Guid runId, RunReplayRequest request, CancellationToken cancellationToken = default)

runId Guid

The identity of the source run.

request RunReplayRequest

The conditions to modify.

cancellationToken CancellationToken

The cancellation token.

ValueTask<RunReplayPreparation>

The preparation result.

ArgumentNullException

request is null.