ChatCompletionCollectorHolder
NexusLabs.Foundry.MicrosoftAgentFramework¶
NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics¶
ChatCompletionCollectorHolder Class¶
DI-registered singleton that holds the IChatCompletionCollector instance. The diagnostics middleware sets the real collector during factory construction; consumers resolve this to access it. Unlike a static holder, each DI container has its own instance, making it testable and thread-safe across containers.
public sealed class ChatCompletionCollectorHolder : NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.IChatCompletionCollector
Inheritance System.Object 🡒 ChatCompletionCollectorHolder
Implements IChatCompletionCollector
Methods¶
ChatCompletionCollectorHolder.DrainCompletions() Method¶
Drains all captured completions since the last drain. Thread-safe. Returns an empty list if no completions have been recorded.
public System.Collections.Generic.IReadOnlyList<NexusLabs.Foundry.MicrosoftAgentFramework.Diagnostics.ChatCompletionDiagnostics> DrainCompletions();
Implements DrainCompletions()
Returns¶
System.Collections.Generic.IReadOnlyList<ChatCompletionDiagnostics>