IChatClientDecorator<T>
Interfaces · AiDotNet.Interfaces
A chat client that wraps another one and can hand out the client it wraps.
Implements: IChatClient<T>
Known implementations: MiddlewareChatClient<T>, RecordingChatClient<T>
For Beginners
Think of the layers as boxes inside boxes. This lets code that needs the thing in the middle open the boxes, instead of giving up because the outside box is the wrong shape.
How It Works
A production chat client is usually a stack: retry around telemetry around content filtering around the client that actually calls a model. That is invisible to callers who only send messages, and it should be. It is not invisible to a caller that needs a capability of the innermost client rather than of the stack, such as asking every member of an ensemble to score a candidate instead of asking the one member the ensemble would have picked. Without a way to look through the wrappers, such a caller sees only the outermost object, silently finds no ensemble, and quietly does something less useful than what it was configured to do.
Properties
| Property | Summary |
|---|---|
IChatClient<T> Inner { get; } |
Gets the client this one wraps. |