Table of Contents

Method StreamWithAgentLabelsAsync

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

StreamWithAgentLabelsAsync(IOrchestrator, string, OrchestrationOptions, CancellationToken)

Streams content with agent labels, showing which agent is generating each response.

public static IAsyncEnumerable<(string AgentName, string Text)> StreamWithAgentLabelsAsync(this IOrchestrator orchestrator, string input, OrchestrationOptions options = null, CancellationToken cancellationToken = default)

Parameters

orchestrator IOrchestrator

The orchestrator to execute.

input string

The input prompt.

options OrchestrationOptions

Optional orchestration options.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<(string AgentName, string Text)>

An async enumerable of tuples containing agent name and content text.

Examples

await foreach (var (agentName, text) in orchestrator.StreamWithAgentLabelsAsync("Task"))
{
    Console.Write($"[{agentName}] {text}");
}
Share