Table of Contents

Property ReasoningTrace

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

ReasoningTrace

Gets the reasoning trace produced during execution, if any.

public string ReasoningTrace { get; }

Property Value

string

Examples

Viewing the reasoning trace:

using LMKit.Model;
using LMKit.Agents;

using var model = new LM("path/to/model.gguf");
var agent = new Agent(model);
agent.Identity = new AgentIdentity("Math Tutor", "Solve problems step by step.");
agent.Planning = PlanningStrategy.ChainOfThought;

var result = agent.Run("If a train travels 120 km in 2 hours, what is its average speed?");

Console.WriteLine("Answer:");
Console.WriteLine(result.Content);

if (!string.IsNullOrEmpty(result.ReasoningTrace))
{
    Console.WriteLine("\nReasoning:");
    Console.WriteLine(result.ReasoningTrace);
}

Remarks

Contains internal reasoning steps when using planning strategies that produce explicit reasoning, such as ChainOfThought or ReAct. May be null if no reasoning trace was generated (e.g., when using None).