mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 17:27:21 +00:00
Added importing of configurations exported from AI Studio (#1007)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f8c0232cfd
commit
22065783c2
49 files changed
+3257
-263
No files matched your search
@@ -89,6 +89,12 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
|
||||
[Parameter]
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The API key an imported transcription provider brought along. When editing, the dialog loads the stored key instead.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string ImportedAPIKey { get; set; } = string.Empty;
|
||||
|
||||
[Inject]
|
||||
private RustService RustService { get; init; } = null!;
|
||||
|
||||
@@ -197,6 +203,14 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
|
||||
|
||||
await this.ReloadModels();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataAPIKey = this.ImportedAPIKey;
|
||||
|
||||
// An import does not contact the server, so its model is the only one to choose until the user loads the models:
|
||||
if (!string.IsNullOrWhiteSpace(this.DataModel.Id))
|
||||
this.availableModels.Add(this.DataModel);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
@@ -346,4 +360,4 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
|
||||
};
|
||||
|
||||
private bool IsNoneProvider => this.DataLLMProvider is LLMProviders.NONE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user