Method Stopped
- Namespace
- LMKit.Agents.Orchestration.Nodes
- Assembly
- LM-Kit.NET.dll
Stopped(string, string)
Creates a result that signals early termination of the graph.
public static NodeResult Stopped(string outputSoFar, string reason)
Parameters
Returns
Examples
Halting the graph from a guard node when input is malformed:
using LMKit.Agents.Orchestration.Nodes;
public sealed class GuardNode : IOrchestrationNode
{
public string Name => "guard";
public Task<NodeResult> InvokeAsync(NodeContext context, CancellationToken ct)
{
if (string.IsNullOrWhiteSpace(context.Input))
return Task.FromResult(NodeResult.Stopped(string.Empty, "empty-input"));
return Task.FromResult(NodeResult.Success(context.Input));
}
}