mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 11:18:00 +00:00
Share the conversation reset across assistants
This commit is contained in:
3 files changed
+16
-6
No files matched your search
@@ -753,9 +753,7 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
|||||||
await this.AssistantSessionService.ClearAsync(this.assistantSessionKey);
|
await this.AssistantSessionService.ClearAsync(this.assistantSessionKey);
|
||||||
this.MediaTranscriptionService.ClearOwnerState(this.CurrentMediaImportOwner);
|
this.MediaTranscriptionService.ClearOwnerState(this.CurrentMediaImportOwner);
|
||||||
this.assistantSessionId = null;
|
this.assistantSessionId = null;
|
||||||
this.ChatThread = null;
|
this.ClearConversationState();
|
||||||
this.LastUserPrompt = null;
|
|
||||||
this.ResultingContentBlock = null;
|
|
||||||
this.ProviderSettings = Settings.Provider.NONE;
|
this.ProviderSettings = Settings.Provider.NONE;
|
||||||
|
|
||||||
await this.JsRuntime.ClearDiv(BEFORE_RESULT_DIV_ID);
|
await this.JsRuntime.ClearDiv(BEFORE_RESULT_DIV_ID);
|
||||||
|
|||||||
@@ -34,4 +34,18 @@ public abstract class AssistantLowerBase : MSGComponentBase
|
|||||||
protected ContentBlock? ResultingContentBlock;
|
protected ContentBlock? ResultingContentBlock;
|
||||||
protected string[] InputIssues = [];
|
protected string[] InputIssues = [];
|
||||||
protected bool IsProcessing;
|
protected bool IsProcessing;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears everything one assistant run has produced.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Assistants call this whenever the previous run must not carry over: a follow-up run would
|
||||||
|
/// otherwise append to the old chat thread, and the old result would stay on screen.
|
||||||
|
/// </remarks>
|
||||||
|
protected void ClearConversationState()
|
||||||
|
{
|
||||||
|
this.ChatThread = null;
|
||||||
|
this.LastUserPrompt = null;
|
||||||
|
this.ResultingContentBlock = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -479,9 +479,7 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
|
|||||||
|
|
||||||
this.inputPrompt = this.optimizedPrompt;
|
this.inputPrompt = this.optimizedPrompt;
|
||||||
this.ResetOutput();
|
this.ResetOutput();
|
||||||
this.ChatThread = null;
|
this.ClearConversationState();
|
||||||
this.LastUserPrompt = null;
|
|
||||||
this.ResultingContentBlock = null;
|
|
||||||
this.ClearInputIssues();
|
this.ClearInputIssues();
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user