Table of Contents

Method Cancelled

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

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

partialContent string

Any partial content generated before cancellation.

toolCalls IReadOnlyList<ToolCallResult>

Any tool calls made before cancellation.

duration TimeSpan

The execution duration until cancellation.

inferenceCount int

The 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