Class AgentExecutionException
- Namespace
- LMKit.Agents.Resilience
- Assembly
- LM-Kit.NET.dll
Exception representing a failed agent execution.
public sealed class AgentExecutionException : Exception, ISerializable
- Inheritance
-
AgentExecutionException
- Implements
- Inherited Members
Examples
Wrapping a non-completed agent run as a throwing call site:
using LMKit.Agents;
using LMKit.Agents.Resilience;
var result = await agent.RunAsync("Generate report.");
if (result.Status != AgentExecutionStatus.Completed)
{
throw new AgentExecutionException($"Agent finished with status {result.Status}", result);
}
Constructors
- AgentExecutionException(string, AgentExecutionResult)
Initializes a new instance of the AgentExecutionException class.
- AgentExecutionException(string, AgentExecutionResult, Exception)
Initializes a new instance with an inner exception.
Properties
- Result
Gets the execution result that caused the exception.