Lingua

InMemoryChatHistoryProviderOptions Class

Definition

Represents configuration options for InMemoryChatHistoryProvider.

public sealed class InMemoryChatHistoryProviderOptions
type InMemoryChatHistoryProviderOptions = class
Public NotInheritable Class InMemoryChatHistoryProviderOptions
Inheritance
InMemoryChatHistoryProviderOptions

Constructors

Name Description
InMemoryChatHistoryProviderOptions()

Properties

Name Description
ChatReducer

Gets or sets an optional IChatReducer instance used to process, reduce, or optimize chat messages. This can be used to implement strategies like message summarization, truncation, or cleanup.

JsonSerializerOptions

Gets or sets optional JSON serializer options for serializing the state of this provider. This is valuable for cases like when the chat history contains custom AIContent types and source generated serializers are required, or Native AOT / Trimming is required.

ProvideOutputMessageFilter

Gets or sets an optional filter function applied to messages produced by this provider during InvokingAsync(ChatHistoryProvider+InvokingContext, CancellationToken).

ReducerTriggerEvent

Gets or sets when the message reducer should be invoked. The default is BeforeMessagesRetrieval, which applies reduction logic when messages are retrieved for agent consumption.

StateInitializer

Gets or sets an optional delegate that initializes the provider state on the first invocation. If null, a default initializer that creates an empty state will be used.

StateKey

Gets or sets an optional key to use for storing the state in the StateBag. If null, a default key will be used.

StorageInputRequestMessageFilter

Gets or sets an optional filter function applied to request messages before they are added to storage during InvokedAsync(ChatHistoryProvider+InvokedContext, CancellationToken).

StorageInputResponseMessageFilter

Gets or sets an optional filter function applied to response messages before they are added to storage during InvokedAsync(ChatHistoryProvider+InvokedContext, CancellationToken).

Applies to