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
errorstringexceptionExceptionagentResultsIReadOnlyList<AgentExecutionResult>durationTimeSpantotalInferenceCountint
Returns
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);
}