LoggingChatClient class
A delegating chat client that logs chat operations to an Logger.
At LogLevel.debug, the method name is logged at the start and end of each call. At LogLevel.trace, the messages, options, response, and streaming updates are also logged. Errors and cancellations are logged at LogLevel.error and LogLevel.debug respectively.
- Inheritance
-
- Object
- DelegatingChatClient
- LoggingChatClient
- Available extensions
Constructors
- LoggingChatClient(ChatClient innerClient, {required Logger logger})
- Creates a new LoggingChatClient.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- innerClient → ChatClient
-
The inner client to delegate to.
finalinherited
- jsonEncoder ↔ JsonEncoder
-
The JsonEncoder used to serialize log data.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
Performs application-defined tasks associated with freeing, releasing,
or resetting unmanaged resources.
inherited
-
getChatResponse(
{required Iterable< ChatMessage> messages, ChatOptions? options, CancellationToken? cancellationToken}) → Future<ChatResponse> -
Sends a chat request and returns the complete response.
override
-
getChatResponseFromMessage(
ChatMessage message, {ChatOptions? options, CancellationToken? cancellationToken}) → Future< ChatResponse> -
Available on ChatClient, provided by the ChatClientExtensions extension
Sends a single message and returns the response. -
getChatResponseFromText(
String message, {ChatOptions? options, CancellationToken? cancellationToken}) → Future< ChatResponse> -
Available on ChatClient, provided by the ChatClientExtensions extension
Sends a single user text message and returns the response. -
getService<
T> ({Object? key}) → T? -
Gets a service of the specified type.
inherited
-
getStreamingChatResponse(
{required Iterable< ChatMessage> messages, ChatOptions? options, CancellationToken? cancellationToken}) → Stream<ChatResponseUpdate> -
Sends a chat request and returns a stream of response updates.
override
-
getStreamingChatResponseFromMessage(
ChatMessage message, {ChatOptions? options, CancellationToken? cancellationToken}) → Stream< ChatResponseUpdate> -
Available on ChatClient, provided by the ChatClientExtensions extension
Sends a single message and returns a streaming response. -
getStreamingChatResponseFromText(
String message, {ChatOptions? options, CancellationToken? cancellationToken}) → Stream< ChatResponseUpdate> -
Available on ChatClient, provided by the ChatClientExtensions extension
Sends a single user text message and returns a streaming response. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited