mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 16:33:48 +00:00
Mode model loading returning enumerable list of data
This commit is contained in:
3 files changed
+7
-7
No files matched your search
@@ -155,20 +155,20 @@ public sealed class ProviderOpenAI() : BaseProvider("https://api.openai.com/v1/"
|
||||
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IList<Model>> GetTextModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default)
|
||||
public Task<IEnumerable<Model>> GetTextModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default)
|
||||
{
|
||||
return await this.LoadModels(jsRuntime, settings, "gpt-", token);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IList<Model>> GetImageModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default)
|
||||
public Task<IEnumerable<Model>> GetImageModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default)
|
||||
{
|
||||
return await this.LoadModels(jsRuntime, settings, "dall-e-", token);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private async Task<IList<Model>> LoadModels(IJSRuntime jsRuntime, SettingsManager settings, string prefix, CancellationToken token)
|
||||
private async Task<IEnumerable<Model>> LoadModels(IJSRuntime jsRuntime, SettingsManager settings, string prefix, CancellationToken token)
|
||||
{
|
||||
var requestedSecret = await settings.GetAPIKey(jsRuntime, this);
|
||||
if(!requestedSecret.Success)
|
||||
|
||||
Reference in new issue
Block a user