| | | 1 | | using Microsoft.Extensions.AI; |
| | | 2 | | |
| | | 3 | | namespace NexusLabs.Needlr.AgentFramework; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Provides context to an <see cref="IWorkflowTerminationCondition"/> when evaluating whether a |
| | | 7 | | /// workflow should stop after an agent's response. |
| | | 8 | | /// </summary> |
| | | 9 | | public sealed class TerminationContext |
| | | 10 | | { |
| | | 11 | | /// <summary>Gets the executor ID of the agent that produced this response.</summary> |
| | 52 | 12 | | public required string AgentId { get; init; } |
| | | 13 | | |
| | | 14 | | /// <summary>Gets the complete response text emitted by the agent for this turn.</summary> |
| | 63 | 15 | | public required string ResponseText { get; init; } |
| | | 16 | | |
| | | 17 | | /// <summary>Gets the number of agent turns completed so far (1-based).</summary> |
| | 36 | 18 | | public required int TurnCount { get; init; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Gets the accumulated conversation history up to and including this turn. |
| | | 22 | | /// Each entry corresponds to one completed agent response. |
| | | 23 | | /// </summary> |
| | 36 | 24 | | public required IReadOnlyList<ChatMessage> ConversationHistory { get; init; } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Gets token usage for this turn, if reported by the model. May be <see langword="null"/> |
| | | 28 | | /// when the model does not return usage metadata. |
| | | 29 | | /// </summary> |
| | 4 | 30 | | public UsageDetails? Usage { get; init; } |
| | | 31 | | } |