Skip to content

InMemoryTranscriptWriter

NexusLabs.Needlr.AgentFramework.Workflows

NexusLabs.Needlr.AgentFramework.Workflows.Middleware

InMemoryTranscriptWriter Class

In-memory ITranscriptWriter that stores entries in a list. Useful for testing and scenarios where transcript data is consumed programmatically after execution.

public sealed class InMemoryTranscriptWriter : NexusLabs.Needlr.AgentFramework.Workflows.Middleware.ITranscriptWriter

Inheritance System.Object 🡒 InMemoryTranscriptWriter

Implements ITranscriptWriter

Properties

InMemoryTranscriptWriter.Entries Property

Gets the transcript entries recorded so far, in order.

public System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.AgentFramework.Workflows.Middleware.TranscriptEntry> Entries { get; }

Property Value

System.Collections.Generic.IReadOnlyList<TranscriptEntry>

Methods

InMemoryTranscriptWriter.WriteRequest(string, IEnumerable<ChatMessage>, ChatOptions) Method

Records the messages and options sent to the LLM.

public void WriteRequest(string stageName, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Extensions.AI.ChatOptions? options);

Parameters

stageName System.String

The name of the pipeline stage making the request.

messages System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage>

The chat messages sent to the LLM.

options Microsoft.Extensions.AI.ChatOptions

The chat options used for the request, if any.

Implements WriteRequest(string, IEnumerable<ChatMessage>, ChatOptions)

InMemoryTranscriptWriter.WriteResponse(string, ChatResponse) Method

Records the response received from the LLM.

public void WriteResponse(string stageName, Microsoft.Extensions.AI.ChatResponse response);

Parameters

stageName System.String

The name of the pipeline stage that received the response.

response Microsoft.Extensions.AI.ChatResponse

The chat response from the LLM.

Implements WriteResponse(string, ChatResponse)