mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-03 13:02:01 +00:00
19 lines
4.7 KiB
Plaintext
19 lines
4.7 KiB
Plaintext
@using AIStudio.Settings
|
|
@using AIStudio.Settings.DataModel
|
|
@inherits MSGComponentBase
|
|
|
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
|
@T("When a chat grows too long for the context window of its model, AI Studio can compress it: a model summarizes the earlier messages, and the conversation continues with the summary. Every further message then costs fewer tokens.")
|
|
</MudJustifiedText>
|
|
|
|
<MudPaper Class="pa-3 mb-3 border-dashed border rounded-lg">
|
|
<ConfigurationSelect OptionDescription="@T("What should happen when a chat grows too long for the context window?")" SelectedValue="@(() => this.SettingsManager.ConfigurationData.ChatCompression.ContextWindowFullBehavior)" Data="@ConfigurationSelectDataFactory.GetContextWindowFullBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.ChatCompression.ContextWindowFullBehavior = selectedValue)" OptionHelp="@TA("Assistants cannot compress their request: they ask you, unless you choose to send without asking. The BeyondFacts Lab and chats without workspaces always replace the earlier messages, since they cannot continue in a new chat.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.ContextWindowFullBehavior, out var meta) && meta.IsLocked"/>
|
|
<ConfigurationSlider T="int" OptionDescription="@T("Fill level of the context window from which AI Studio steps in")" Min="@DataChatCompression.MIN_CONTEXT_WINDOW_THRESHOLD_PERCENT" Max="@DataChatCompression.MAX_CONTEXT_WINDOW_THRESHOLD_PERCENT" Step="5" Unit="%" Value="@(() => this.SettingsManager.ConfigurationData.ChatCompression.ContextWindowThresholdPercent)" ValueUpdate="@(updatedValue => this.SettingsManager.ConfigurationData.ChatCompression.ContextWindowThresholdPercent = updatedValue)" OptionHelp="@TA("Before sending a message, AI Studio checks how full the context window of the model would be. From this share on, it does what you chose above. A lower share keeps more room for long answers.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.ContextWindowThresholdPercent, out var meta) && meta.IsLocked"/>
|
|
</MudPaper>
|
|
|
|
<MudPaper Class="pa-3 mb-3 border-dashed border rounded-lg">
|
|
<ConfigurationMinConfidenceSelection RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.ChatCompression.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.ChatCompression.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
|
|
<ConfigurationProviderSelection Component="Components.AI_TASK_CHAT_COMPRESSION" EmptySelectionText="@T("Use the model of the chat")" Data="@this.AvailableLLMProviders" SelectedValue="@(() => this.SettingsManager.ConfigurationData.ChatCompression.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.ChatCompression.PreselectedProvider = selectedValue)" HelpText="@(() => TA("Optionally choose a model for writing summaries, e.g., one with a large context window, which summarizes long chats in fewer steps. When it may not see a chat, e.g., because of the data sources of the chat, the model of the chat writes the summary."))" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
|
|
<ConfigurationSlider T="int" OptionDescription="@T("Longest summary")" Min="@DataChatCompression.MIN_SUMMARY_TOKENS" Max="@DataChatCompression.MAX_SUMMARY_TOKENS" Step="1024" Unit="@T("tokens")" Value="@(() => this.SettingsManager.ConfigurationData.ChatCompression.MaxSummaryTokens)" ValueUpdate="@(updatedValue => this.SettingsManager.ConfigurationData.ChatCompression.MaxSummaryTokens = updatedValue)" OptionHelp="@T("A summary takes at most a quarter of the context window, and never more than this. A longer summary keeps more details, but leaves less room for the rest of the conversation.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.MaxSummaryTokens, out var meta) && meta.IsLocked"/>
|
|
<ConfigurationText OptionDescription="@T("Preselect what the summary should pay particular attention to")" Icon="@AppIcons.SUMMARY_FOCUS" Text="@(() => this.SettingsManager.ConfigurationData.ChatCompression.PreselectedFocus)" TextUpdate="@(updatedText => this.SettingsManager.ConfigurationData.ChatCompression.PreselectedFocus = updatedText)" OptionHelp="@TA("Compressing starts with this focus, and in the dialog, you can still change it. For example: the decisions about the budget, with all figures.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.ChatCompression, x => x.PreselectedFocus, out var meta) && meta.IsLocked"/>
|
|
</MudPaper> |