Method Cancelled
Cancelled(string, IReadOnlyList<ToolCallResult>, TimeSpan, int)
Creates a cancelled execution result.
public static AgentExecutionResult Cancelled(string partialContent = null, IReadOnlyList<ToolCallResult> toolCalls = null, TimeSpan duration = default, int inferenceCount = 0)
Parameters
partialContentstringAny partial content generated before cancellation.
toolCallsIReadOnlyList<ToolCallResult>Any tool calls made before cancellation.
durationTimeSpanThe execution duration until cancellation.
inferenceCountintThe number of inference calls made.
Returns
- AgentExecutionResult
A new cancelled AgentExecutionResult.
Examples
Creating a cancellation result (for custom executors):
using LMKit.Agents;
// When cancellation is detected
var result = AgentExecutionResult.Cancelled(
partialContent: "I was in the middle of explaining...",
duration: TimeSpan.FromSeconds(5),
inferenceCount: 2
);
Console.WriteLine(result.IsCancelled); // True
Console.WriteLine(result.Content); // Partial content