Class TracingAgentExecutor
- Namespace
- LMKit.Agents.Observability
- Assembly
- LM-Kit.NET.dll
An agent executor wrapper that adds tracing to all operations.
Wraps an existing executor and adds spans for agent execution, tool calls, planning steps, and other operations.
public sealed class TracingAgentExecutor : IAgentExecutor, IDisposable
- Inheritance
-
TracingAgentExecutor
- Implements
- Inherited Members
Examples
var tracer = new ConsoleTracer();
var executor = new TracingAgentExecutor(tracer);
var result = await executor.ExecuteAsync(agent, "Hello");
// Console shows execution trace
Constructors
- TracingAgentExecutor()
Initializes a new instance using the global tracer.
- TracingAgentExecutor(IAgentTracer)
Initializes a new instance with the specified tracer.
- TracingAgentExecutor(IAgentTracer, AgentMetrics)
Initializes a new instance with the specified tracer and metrics.
Properties
- CurrentSpan
Gets the current active span, if any.
- RecordMetrics
Gets or sets whether to record metrics automatically.
Methods
- Dispose()
Disposes the executor.
- Execute(Agent, string, AgentExecutionOptions, CancellationToken)
Executes an agent with tracing and options.
- Execute(Agent, string, CancellationToken)
Executes an agent with tracing (interface implementation).
- ExecuteAsync(Agent, string, AgentExecutionOptions, CancellationToken)
Executes an agent asynchronously with tracing and options.
- ExecuteAsync(Agent, string, CancellationToken)
Executes an agent asynchronously with tracing (interface implementation).