ReasoningResult<T>

Models & Types · AiDotNet.Reasoning.Models

Represents the complete result of a reasoning process, including the answer, reasoning chain, and performance metrics.

For Beginners

Think of ReasoningResult as the complete package you get back after the AI solves a problem. It’s like when you finish a homework problem and you have:

  • The final answer
  • All your work showing how you got there
  • Notes about which parts you checked or corrected
  • How long it took you
  • How confident you are about the answer

This class bundles all of that information together in one place, making it easy to work with the results of reasoning.

How It Works

Example Usage:

Constructors

Constructor Summary
ReasoningResult() Initializes a new instance of the ReasoningResult class.

Properties

Property Summary
Dictionary<string, object> Metadata { get; set; } Additional metadata or context about this reasoning result.
Dictionary<string, object> Metrics { get; set; } Performance metrics and statistics about the reasoning process.
List<ReasoningChain<T>> AlternativeChains { get; set; } Alternative reasoning chains that were explored (for strategies like Tree-of-Thoughts).
List<string> ToolsUsed { get; set; } Tools or external resources that were used during reasoning.
List<string> VerificationFeedback { get; set; } Verification results and feedback from critic models.
ReasoningChain<T> ReasoningChain { get; set; } The complete chain of reasoning steps that led to the final answer.
T OverallConfidence { get; set; } Overall confidence score for the final answer (0.0 to 1.0).
TimeSpan TotalDuration { get; set; } Total time spent on the reasoning process.
Vector<T> ConfidenceScores { get; set; } Vector of confidence scores across all attempted reasoning paths.
bool Success { get; set; } Whether the reasoning process completed successfully.
string ErrorMessage { get; set; } Error message if the reasoning failed (null if successful).
string FinalAnswer { get; set; } The final answer or solution from the reasoning process.
string StrategyUsed { get; set; } The strategy that was used for reasoning (e.g., “Chain-of-Thought”, “Tree-of-Thoughts”).

Methods

Method Summary
string GetSummary() Creates a summary string of the reasoning result.
string ToString() Returns a string representation of this reasoning result.