mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 07:38:00 +00:00
Fixed handling of instance names while provider creation
This commit is contained in:
3 files changed
+7
-11
No files matched your search
@@ -72,12 +72,10 @@ public partial class ProviderDialog : ComponentBase
|
||||
if(this.IsEditing)
|
||||
{
|
||||
this.dataEditingPreviousInstanceName = this.DataInstanceName.ToLowerInvariant();
|
||||
var provider = this.DataProvider.CreateProvider();
|
||||
var provider = this.DataProvider.CreateProvider(this.DataInstanceName);
|
||||
if(provider is NoProvider)
|
||||
return;
|
||||
|
||||
provider.InstanceName = this.DataInstanceName;
|
||||
|
||||
// Load the API key:
|
||||
var requestedSecret = await this.SettingsManager.GetAPIKey(this.JsRuntime, provider);
|
||||
if(requestedSecret.Success)
|
||||
@@ -124,8 +122,7 @@ public partial class ProviderDialog : ComponentBase
|
||||
};
|
||||
|
||||
// We need to instantiate the provider to store the API key:
|
||||
var provider = this.DataProvider.CreateProvider();
|
||||
provider.InstanceName = this.DataInstanceName;
|
||||
var provider = this.DataProvider.CreateProvider(this.DataInstanceName);
|
||||
|
||||
// Store the API key in the OS secure storage:
|
||||
var storeResponse = await this.SettingsManager.SetAPIKey(this.JsRuntime, provider, this.dataAPIKey);
|
||||
|
||||
Reference in new issue
Block a user