mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-04 09:46:27 +00:00
Added settings for chat compression, with a model of its own (#1241)
This commit is contained in:
1 parent
899139c88b
commit
1fbc1f4796
71 files changed
+3023
-797
No files matched your search
@@ -1127,6 +1127,9 @@ public static class AppIcons
|
||||
/// <summary>Reports success or a completed, confirmed, or configured state.</summary>
|
||||
public const string SUCCESS = LucideIcons.CIRCLE_CHECK;
|
||||
|
||||
/// <summary>Marks what a summary should pay particular attention to, such as when compressing a chat.</summary>
|
||||
public const string SUMMARY_FOCUS = LucideIcons.FOCUS;
|
||||
|
||||
/// <summary>Marks the supporters of AI Studio.</summary>
|
||||
public const string SUPPORTERS = LucideIcons.HEART;
|
||||
|
||||
|
||||
@@ -45,4 +45,5 @@ public enum Components
|
||||
BATCH_PROCESSING_ASSISTANT,
|
||||
BEYOND_FACTS_LAB_ASSISTANT,
|
||||
MODEL_COMPARISON_ASSISTANT,
|
||||
AI_TASK_CHAT_COMPRESSION,
|
||||
}
|
||||
@@ -127,6 +127,7 @@ public static class ComponentsExtensions
|
||||
Components.AI_TASK_DATA_SOURCE_SELECTION => false,
|
||||
Components.AI_TASK_RETRIEVAL_CONTEXT_VALIDATION => false,
|
||||
Components.AI_TASK_ASSISTANT_PLUGIN_AUDIT => false,
|
||||
Components.AI_TASK_CHAT_COMPRESSION => false,
|
||||
Components.META_ASSISTANT => false,
|
||||
|
||||
_ => true,
|
||||
@@ -228,6 +229,9 @@ public static class ComponentsExtensions
|
||||
Components.AI_TASK_RETRIEVAL_CONTEXT_VALIDATION => settingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions ? settingsManager.ConfigurationData.RetrievalContextValidation.MinimumProviderConfidence : default,
|
||||
Components.AI_TASK_ASSISTANT_PLUGIN_AUDIT => settingsManager.ConfigurationData.AssistantPluginAudit.MinimumProviderConfidence,
|
||||
|
||||
// Without a switch for its preselection, and only for the provider picked for it, see DataChatCompression:
|
||||
Components.AI_TASK_CHAT_COMPRESSION => settingsManager.ConfigurationData.ChatCompression.MinimumProviderConfidence,
|
||||
|
||||
_ => default,
|
||||
};
|
||||
|
||||
|
||||
@@ -437,6 +437,20 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.AssistantPluginAudit, x => x.BlockActivationBelowMinimum, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.AssistantPluginAudit, x => x.AutomaticallyAuditAssistants, this.Id, settingsTable, dryRun);
|
||||
|
||||
// Config: chat compression settings
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.PreselectedProvider, Guid.Empty, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.MinimumProviderConfidence, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.PreselectedFocus, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.ContextWindowFullBehavior, this.Id, settingsTable, dryRun);
|
||||
|
||||
var thresholdIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.ContextWindowThresholdPercent, this.Id, settingsTable, dryRun, validator: DataChatCompression.IsValidContextWindowThresholdPercent);
|
||||
if (!thresholdIsValid && settingsTable.TryGetValue("DataChatCompression.ContextWindowThresholdPercent", out _))
|
||||
LOG.LogWarning("The share of the context window configured by plugin {ConfigPluginId} for chat compression must be between {MinimumPercent} and {MaximumPercent} percent.", this.Id, DataChatCompression.MIN_CONTEXT_WINDOW_THRESHOLD_PERCENT, DataChatCompression.MAX_CONTEXT_WINDOW_THRESHOLD_PERCENT);
|
||||
|
||||
var maxSummaryTokensIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.ChatCompression, x => x.MaxSummaryTokens, this.Id, settingsTable, dryRun, validator: DataChatCompression.IsValidMaxSummaryTokens);
|
||||
if (!maxSummaryTokensIsValid && settingsTable.TryGetValue("DataChatCompression.MaxSummaryTokens", out _))
|
||||
LOG.LogWarning("The most tokens of a summary configured by plugin {ConfigPluginId} for chat compression must be between {MinimumTokens} and {MaximumTokens}.", this.Id, DataChatCompression.MIN_SUMMARY_TOKENS, DataChatCompression.MAX_SUMMARY_TOKENS);
|
||||
|
||||
// Config: enterprise-managed approvals for assistant plugins
|
||||
this.TryProcessEnterpriseApprovedAssistantPlugins(settingsTable, dryRun);
|
||||
|
||||
|
||||
Reference in new issue
Block a user