IDiagnosticsSink
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework.Diagnostics¶
IDiagnosticsSink Interface¶
Accepts diagnostic records produced during an agent run. Writers (middleware, orchestration loops) call these methods to record individual chat completions and tool calls. The sink is responsible for storage and aggregation.
Derived
↳ AgentRunDiagnosticsBuilder
↳ TeeDiagnosticsSink
Remarks¶
Each event class (chat completion, tool call) should have exactly one writer. Two writers recording the same logical event is a bug — the sink does not deduplicate. Use the single-writer middleware pattern to prevent this.
Today's concrete implementation is AgentRunDiagnosticsBuilder. Future implementations may fan out to multiple storage backends (in-memory, file, progress reporter).
Properties¶
IDiagnosticsSink.AgentName Property¶
Gets the name of the agent associated with this sink, or null if unknown. Writers use this to attribute diagnostic records to the correct agent.
Property Value¶
Methods¶
IDiagnosticsSink.AddChatCompletion(ChatCompletionDiagnostics) Method¶
Records a completed chat completion call.
void AddChatCompletion(NexusLabs.Needlr.AgentFramework.Diagnostics.ChatCompletionDiagnostics diagnostics);
Parameters¶
diagnostics ChatCompletionDiagnostics
IDiagnosticsSink.AddToolCall(ToolCallDiagnostics) Method¶
Records a completed tool call.
Parameters¶
diagnostics ToolCallDiagnostics
IDiagnosticsSink.NextChatCompletionSequence() Method¶
Reserves a sequence number for a chat completion (thread-safe).
Returns¶
IDiagnosticsSink.NextToolCallSequence() Method¶
Reserves a sequence number for a tool call (thread-safe).