Table of Contents

Constructor NodeContext

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

NodeContext(string, OrchestrationContext, OrchestrationOptions)

Initializes a new NodeContext.

public NodeContext(string input, OrchestrationContext orchestration, OrchestrationOptions options)

Parameters

input string
orchestration OrchestrationContext
options OrchestrationOptions

Examples

Implementing a custom IOrchestrationNode that consumes NodeContext:

using LMKit.Agents.Orchestration;
using LMKit.Agents.Orchestration.Nodes;

public sealed class UpperCaseNode : IOrchestrationNode { public string Name => "uppercase";

public Task<NodeResult> InvokeAsync(NodeContext context, CancellationToken ct)
{
    // Read this node's input from the flowing context.
    string output = context.Input?.ToUpperInvariant() ?? string.Empty;

    // Record a trace into the shared OrchestrationContext for observability.
    context.Orchestration.AddTrace($"upper-cased {context.Input?.Length ?? 0} chars");

    return Task.FromResult(NodeResult.Success(output));
}

}

NodeContext(string, OrchestrationContext, OrchestrationOptions, OrchestratorBase)

Initializes a new NodeContext with an explicit host orchestrator.

public NodeContext(string input, OrchestrationContext orchestration, OrchestrationOptions options, OrchestratorBase host)

Parameters

input string
orchestration OrchestrationContext
options OrchestrationOptions
host OrchestratorBase
Share