Table of Contents

Method PrepareRetry

Namespace
LMKit.Agents.Workflows
Assembly
LM-Kit.NET.dll

PrepareRetry(WorkflowDefinition, AgentRunState, string, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, bool>, string)

Sets a failed run up to resume from its failing step (what RetryAsync(AgentRunState, string, IReadOnlyDictionary<string, string>, IReadOnlyDictionary<string, bool>, string, OrchestrationOptions, CancellationToken) plays): the run is suspended again with no step to resume at, so the resumed play replays every completed step from its recorded output and makes the failing step again. The attempts of every step not completed are cleared (its retry policy applies anew); error steps that already ran replay their record should the step fail again, so nothing they sent is sent twice. A write recorded as possibly made is settled by reconciled when it names it (true: it happened, its step completes on that; false: it did not, it is sent again); otherwise it is left in doubt, so the resumed play sends it again only under the same idempotency key to a tool that honors keys, and otherwise waits for a person to say.

public static void PrepareRetry(WorkflowDefinition definition, AgentRunState state, string input = null, IReadOnlyDictionary<string, string> variables = null, IReadOnlyDictionary<string, bool> reconciled = null, string detail = null)

Parameters

definition WorkflowDefinition

The workflow the run plays.

state AgentRunState

The failed run, changed in place.

input string

A corrected input, or null to keep the run's.

variables IReadOnlyDictionary<string, string>

Variables to set or replace, or null.

reconciled IReadOnlyDictionary<string, bool>

For a write whose outcome is unknown, by call id: true when it happened, false when it did not; or null.

detail string

Who retries and why, recorded on the timeline.

Exceptions

ArgumentNullException

Thrown when definition or state is null.

InvalidOperationException

Thrown when the run did not fail.

Share