TerminationContext
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework¶
TerminationContext Class¶
Provides context to an IWorkflowTerminationCondition when evaluating whether a workflow should stop after an agent's response.
Inheritance System.Object 🡒 TerminationContext
Properties¶
TerminationContext.AgentId Property¶
Gets the executor ID of the agent that produced this response.
Property Value¶
TerminationContext.ConversationHistory Property¶
Gets the accumulated conversation history up to and including this turn. Each entry corresponds to one completed agent response.
public System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> ConversationHistory { get; init; }
Property Value¶
System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage>
TerminationContext.LastMessage Property¶
Gets the last Microsoft.Extensions.AI.ChatMessage emitted by the agent for this turn
(preserving full content including function calls, role, and metadata), or
null if the agent produced no message. Use the .Text
property on the message for a flat text view.
Property Value¶
Microsoft.Extensions.AI.ChatMessage
TerminationContext.ToolCallNames Property¶
Gets the names of tools/functions called by the agent during this turn. Extracted from Microsoft.Extensions.AI.FunctionCallContent entries in the last message's Microsoft.Extensions.AI.ChatMessage.Contents. Empty if no tool calls were made.
Property Value¶
System.Collections.Generic.IReadOnlyList<System.String>
TerminationContext.TurnCount Property¶
Gets the number of agent turns completed so far (1-based).
Property Value¶
TerminationContext.Usage Property¶
Gets token usage for this turn, if reported by the model. May be null when the model does not return usage metadata.