Class ChainResult
- Namespace
- AiDotNet.Interfaces
- Assembly
- AiDotNet.dll
Represents the result of executing a prompt chain.
public class ChainResult
- Inheritance
-
ChainResult
- Inherited Members
Remarks
Contains the final output, intermediate results from each step, timing information, and any errors encountered during execution.
For Beginners: This contains everything about what happened during chain execution.
You can see:
- The final result
- What each step produced
- How long each step took
- Any errors that occurred
Example:
var result = await chain.ExecuteAsync("Input...");
Console.WriteLine($"Final: {result.FinalOutput}");
Console.WriteLine($"Total time: {result.TotalDuration}ms");
foreach (var step in result.StepResults)
{
Console.WriteLine($"Step {step.StepName}: {step.Duration}ms");
}
Properties
ErrorMessage
Gets or sets any error that occurred during execution.
public string? ErrorMessage { get; set; }
Property Value
FinalOutput
Gets or sets the final output of the chain.
public string FinalOutput { get; set; }
Property Value
IntermediateOutputs
Gets or sets intermediate outputs keyed by step name.
public IReadOnlyDictionary<string, string> IntermediateOutputs { get; set; }
Property Value
Remarks
Allows accessing the output of any step by name. Useful for debugging and for chains where intermediate results are needed.
IsSuccessful
Gets or sets whether the chain executed successfully.
public bool IsSuccessful { get; set; }
Property Value
StepResults
Gets or sets the results from each step in the chain.
public IReadOnlyList<StepResult> StepResults { get; set; }
Property Value
TotalDurationMs
Gets or sets the total execution duration in milliseconds.
public long TotalDurationMs { get; set; }