Class OrchestrationStreamToken
- Namespace
- LMKit.Agents.Orchestration.Streaming
- Assembly
- LM-Kit.NET.dll
Represents a token in a streaming orchestration response.
Extends the base streaming concept with orchestration-specific context, including which agent generated the token and the current orchestration step.
public sealed class OrchestrationStreamToken
- Inheritance
-
OrchestrationStreamToken
- Inherited Members
Examples
Routing tokens by type while streaming an orchestration:
using LMKit.Agents.Orchestration.Streaming;
await foreach (OrchestrationStreamToken t in orchestrator.StreamAsync("Topic: edge AI"))
{
switch (t.Type)
{
case OrchestrationStreamTokenType.AgentStarted:
Console.WriteLine($"\n--- {t.AgentName} ---");
break;
case OrchestrationStreamTokenType.Thinking:
// Render reasoning into a "thinking..." UI panel.
break;
case OrchestrationStreamTokenType.Content:
Console.Write(t.Text);
break;
case OrchestrationStreamTokenType.ToolCall:
Console.WriteLine($"[tool: {t.Metadata["tool_name"]}]");
break;
}
}
Constructors
- OrchestrationStreamToken(string, OrchestrationStreamTokenType, string, int, int, string, bool, bool, IReadOnlyDictionary<string, object>)
Initializes a new instance of the OrchestrationStreamToken class.
Properties
- AgentName
Gets the name of the agent that generated this token.
- CumulativeText
Gets the cumulative text from the current agent so far.
- IsAgentFinal
Gets a value indicating whether this is the final token from the current agent.
- IsOrchestrationFinal
Gets a value indicating whether this is the final token of the entire orchestration.
- Metadata
Gets optional metadata about this token.
- Step
Gets the current orchestration step (1-based).
- Text
Gets the text content of this token.
- TokenIndex
Gets the index of this token within the current agent's response (0-based).
- Type
Gets the type of this token.
Methods
- AgentCompleted(string, int, int, string, bool)
Creates an agent completed token.
- AgentStarted(string, int, string)
Creates an agent started token.
- Content(string, string, int, int, string, bool)
Creates a content token.
- Delegation(string, string, string, int, int)
Creates a delegation token (when supervisor delegates to worker).
- Error(string, string, int, int)
Creates an error token.
- OrchestrationCompleted(string, int, string)
Creates an orchestration completed token.
- OrchestrationStarted(string, string)
Creates an orchestration started token.
- Status(string, string, int, int)
Creates a status update token.
- Thinking(string, string, int, int, string)
Creates a thinking/reasoning token.
- ToolCall(string, string, string, int, int)
Creates a tool call token.
- ToolResult(string, string, string, int, int)
Creates a tool result token.