< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Workflows.Middleware.ChatClientBuilderTranscriptExtensions
Assembly: NexusLabs.Needlr.AgentFramework.Workflows
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Workflows/Middleware/ChatClientBuilderTranscriptExtensions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseTranscriptLogging(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Workflows/Middleware/ChatClientBuilderTranscriptExtensions.cs

#LineLine coverage
 1using Microsoft.Extensions.AI;
 2
 3namespace NexusLabs.Needlr.AgentFramework.Workflows.Middleware;
 4
 5/// <summary>
 6/// Extension methods for adding transcript logging to a <see cref="ChatClientBuilder"/> pipeline.
 7/// </summary>
 8public static class ChatClientBuilderTranscriptExtensions
 9{
 10    /// <summary>
 11    /// Inserts a <see cref="TranscriptLoggingChatClient"/> into the pipeline that
 12    /// records every request/response pair to the supplied <paramref name="writer"/>.
 13    /// </summary>
 14    /// <param name="builder">The chat client builder.</param>
 15    /// <param name="writer">The transcript writer to record entries into.</param>
 16    /// <returns>The builder, for chaining.</returns>
 17    public static ChatClientBuilder UseTranscriptLogging(
 18        this ChatClientBuilder builder,
 19        ITranscriptWriter writer)
 20    {
 121        ArgumentNullException.ThrowIfNull(builder);
 122        ArgumentNullException.ThrowIfNull(writer);
 23
 224        return builder.Use(inner => new TranscriptLoggingChatClient(inner, writer));
 25    }
 26}