Allow individual provider & profile reset logic per assistant

This commit is contained in:
Thorsten Sommer 2026-02-01 14:43:25 +01:00
parent 8cdad359a9
commit 25fc742a6f
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -231,6 +231,13 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
return chatId; return chatId;
} }
protected virtual void ResetProviderAndProfileSelection()
{
this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component);
this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component);
this.currentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component);
}
protected DateTimeOffset AddUserRequest(string request, bool hideContentFromUser = false, params List<FileAttachment> attachments) protected DateTimeOffset AddUserRequest(string request, bool hideContentFromUser = false, params List<FileAttachment> attachments)
{ {
@ -372,9 +379,7 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
await this.JsRuntime.ClearDiv(AFTER_RESULT_DIV_ID); await this.JsRuntime.ClearDiv(AFTER_RESULT_DIV_ID);
this.ResetForm(); this.ResetForm();
this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component); this.ResetProviderAndProfileSelection();
this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component);
this.currentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component);
this.inputIsValid = false; this.inputIsValid = false;
this.inputIssues = []; this.inputIssues = [];