Table of Contents

Method Failed

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

Failed(string, Exception, IReadOnlyList<AgentExecutionResult>, TimeSpan, int)

Creates a failed orchestration result.

public static OrchestrationResult Failed(string error, Exception exception = null, IReadOnlyList<AgentExecutionResult> agentResults = null, TimeSpan duration = default, int totalInferenceCount = 0)

Parameters

error string
exception Exception
agentResults IReadOnlyList<AgentExecutionResult>
duration TimeSpan
totalInferenceCount int

Returns

OrchestrationResult

Examples

Surfacing an exception caught inside a custom orchestrator:

try
{
    // ... custom orchestration logic ...
}
catch (Exception ex)
{
    return OrchestrationResult.Failed(
        error: ex.Message,
        exception: ex,
        agentResults: collectedSoFar,
        duration: stopwatch.Elapsed);
}
Share