RecordingChatClient<T>

Models & Types · AiDotNet.Agentic.Pipeline

An IChatClient decorator that calls a real inner client and records each request/response into an IChatInteractionStore. Pair it with ReplayingChatClient to capture a run once and replay it deterministically thereafter.

Implements: IChatClientDecorator<T>

For Beginners

A tape recorder around the model. It passes your request to the real model and quietly saves the answer keyed by the request, so you can play it back later without spending another call. Streaming calls are recorded too: the streamed pieces are reassembled into the final answer and saved when the stream finishes.

Constructors

Constructor Summary
RecordingChatClient(IChatClient<T> inner, IChatInteractionStore store) Initializes a new recording client.

Properties

Property Summary
IChatClient<T> Inner { get; }
string ModelId { get; }

Methods

Method Summary
IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(IReadOnlyList<ChatMessage> messages, ChatOptions options, CancellationToken cancellationToken)
Task<ChatResponse> GetResponseAsync(IReadOnlyList<ChatMessage> messages, ChatOptions options, CancellationToken cancellationToken)