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
orchestratorIOrchestratorThe orchestrator to execute.
inputstringThe input prompt.
optionsOrchestrationOptionsOptional orchestration options.
cancellationTokenCancellationTokenCancellation 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}");
}