Property Status
Status
Gets the execution status indicating how the task completed.
public AgentExecutionStatus Status { get; }
Property Value
Examples
Handling different statuses:
using LMKit.Model;
using LMKit.Agents;
using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);
var result = agent.Run("Solve this problem.");
switch (result.Status)
{
case AgentExecutionStatus.Completed:
Console.WriteLine($"Success: {result.Content}");
break;
case AgentExecutionStatus.Failed:
Console.WriteLine($"Failed: {result.Error?.Message}");
break;
case AgentExecutionStatus.Cancelled:
Console.WriteLine("Cancelled by user.");
break;
}