// Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; using Microsoft.Extensions.AI; using Microsoft.Extensions.Compliance.Redaction; namespace Microsoft.Agents.AI; /// /// Options controlling the behavior of . /// public sealed class ChatHistoryMemoryProviderOptions { /// /// Gets or sets a value indicating when the search should be executed. /// /// by default. public SearchBehavior SearchTime { get; set; } = SearchBehavior.BeforeAIInvoke; /// /// Gets or sets the name of the exposed search tool when operating in on-demand mode. /// /// Defaults to "Search". public string? FunctionToolName { get; set; } /// /// Gets or sets the description of the exposed search tool when operating in on-demand mode. /// /// Defaults to "Allows searching through previous chat history to help answer the user question.". public string? FunctionToolDescription { get; set; } /// /// Gets or sets the context prompt prefixed to results. /// public string? ContextPrompt { get; set; } /// /// Gets or sets the maximum number of results to retrieve from the chat history. /// /// /// Defaults to 3 if not set. /// public int? MaxResults { get; set; } /// /// Gets or sets a value indicating whether sensitive data such as user ids and user messages may appear in logs. /// /// Defaults to . /// /// When set to , sensitive data is passed through to logs unchanged and any /// configured is ignored. This property takes precedence over . /// public bool EnableSensitiveTelemetryData { get; set; } /// /// Gets or sets a custom used to redact sensitive data in log output. /// /// /// When (the default), sensitive data is replaced with a placeholder. /// When set, this redactor is used to transform sensitive values before they are logged. /// Ignored when is . /// public Redactor? Redactor { get; set; } /// /// Gets or sets the key used to store provider state in the . /// /// /// Defaults to the provider's type name. Override this if you need multiple /// instances with separate state in the same session. /// public string? StateKey { get; set; } /// /// Gets or sets an optional filter function applied to request messages when constructing the search text to use /// to search for relevant chat history during . /// /// /// When , the provider defaults to including only /// messages. /// public Func, IEnumerable>? SearchInputMessageFilter { get; set; } /// /// Gets or sets an optional filter function applied to request messages when storing recent chat history /// during . /// /// /// When , the provider defaults to including only /// messages. /// public Func, IEnumerable>? StorageInputRequestMessageFilter { get; set; } /// /// Gets or sets an optional filter function applied to response messages when storing recent chat history /// during . /// /// /// When , the provider does not apply any filtering and includes all response messages. /// public Func, IEnumerable>? StorageInputResponseMessageFilter { get; set; } /// /// Behavior choices for the provider. /// public enum SearchBehavior { /// /// Execute search prior to each invocation and inject results as a message. /// BeforeAIInvoke, /// /// Expose a function tool to perform search on-demand via function/tool calling. /// OnDemandFunctionCalling } }