mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 02:29:40 +00:00
Added the ability to roll back to certain chat messages and to copy an entire chat
This commit is contained in:
1 parent
c95cc5bacc
commit
601fe727ba
12 files changed
+251
-2
No files matched your search
@@ -1394,6 +1394,24 @@ public partial class ChatComponent : MSGComponentBase
|
||||
|
||||
await this.SendMessage(reuseLastUserPrompt: true);
|
||||
}
|
||||
|
||||
private async Task RollbackBlock(IContent aiBlock)
|
||||
{
|
||||
if (this.ChatThread is null || this.IsCurrentChatStreaming)
|
||||
return;
|
||||
|
||||
if (!this.ChatThread.RemoveBlocksAfter(aiBlock))
|
||||
return;
|
||||
|
||||
this.ChatThread.AugmentedData = string.Empty;
|
||||
this.ChatThread.AISelectedDataSources = [];
|
||||
this.dataSourceSelectionComponent?.ChangeOptionWithoutSaving(this.ChatThread.DataSourceOptions, this.ChatThread.AISelectedDataSources);
|
||||
this.hasUnsavedChanges = true;
|
||||
await this.SaveThread();
|
||||
this.tokenTracker?.Nudge();
|
||||
this.StateHasChanged();
|
||||
await this.inputField.FocusAsync();
|
||||
}
|
||||
|
||||
private Task EditLastUserBlock(IContent block)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user