CachingChatClient Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A delegating chat client that caches the results of chat calls.
public ref class CachingChatClient abstract : Microsoft::Extensions::AI::DelegatingChatClient
public abstract class CachingChatClient : Microsoft.Extensions.AI.DelegatingChatClient
type CachingChatClient = class
inherit DelegatingChatClient
Public MustInherit Class CachingChatClient
Inherits DelegatingChatClient
- Inheritance
- Derived
Constructors
CachingChatClient(IChatClient) |
Initializes a new instance of the CachingChatClient class. |
Properties
CoalesceStreamingUpdates |
Gets or sets a value indicating whether to coalesce streaming updates. |
InnerClient |
Gets the inner IChatClient. (Inherited from DelegatingChatClient) |
Metadata |
Gets metadata that describes the IChatClient. (Inherited from DelegatingChatClient) |
Methods
CompleteAsync(IList<ChatMessage>, ChatOptions, CancellationToken) | |
CompleteStreamingAsync(IList<ChatMessage>, ChatOptions, CancellationToken) | |
Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from DelegatingChatClient) |
Dispose(Boolean) |
Provides a mechanism for releasing unmanaged resources. (Inherited from DelegatingChatClient) |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetCacheKey(ReadOnlySpan<Object>) |
Computes a cache key for the specified values. |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetService(Type, Object) |
Asks the IChatClient for an object of the specified type |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ReadCacheAsync(String, CancellationToken) |
Returns a previously cached ChatCompletion, if available. This is used when there is a call to CompleteAsync(IList<ChatMessage>, ChatOptions, CancellationToken). |
ReadCacheStreamingAsync(String, CancellationToken) |
Returns a previously cached list of StreamingChatCompletionUpdate values, if available. This is used when there is a call to CompleteStreamingAsync(IList<ChatMessage>, ChatOptions, CancellationToken). |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
WriteCacheAsync(String, ChatCompletion, CancellationToken) |
Stores a ChatCompletion in the underlying cache. This is used when there is a call to CompleteAsync(IList<ChatMessage>, ChatOptions, CancellationToken). |
WriteCacheStreamingAsync(String, IReadOnlyList<StreamingChatCompletionUpdate>, CancellationToken) |
Stores a list of StreamingChatCompletionUpdate values in the underlying cache. This is used when there is a call to CompleteStreamingAsync(IList<ChatMessage>, ChatOptions, CancellationToken). |