Property IsFailed
IsFailed
Gets a value indicating whether the execution failed.
public bool IsFailed { get; }
Property Value
Examples
Error handling pattern:
using LMKit.Model;
using LMKit.Agents;
using var model = LM.LoadFromModelID("qwen3:8b");
var agent = new Agent(model);
var result = agent.Run("Process this input.");
if (result.IsFailed)
{
// Log the error
Console.WriteLine($"Agent failed: {result.Error?.Message}");
// Return partial content if available
return result.Content ?? "An error occurred.";
}
return result.Content;