Added the no provider

This commit is contained in:
Thorsten Sommer 2024-05-04 11:12:05 +02:00
parent 9f0c1dc410
commit 867de08bfe
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -1,7 +1,12 @@
using System.Runtime.CompilerServices;
using AIStudio.Chat;
using AIStudio.Settings;
using Microsoft.JSInterop;
using MudBlazor;
namespace AIStudio.Provider;
public class NoProvider : IProvider
@ -12,13 +17,21 @@ public class NoProvider : IProvider
public string InstanceName { get; set; } = "None";
public async IAsyncEnumerable<string> GetChatCompletion(IJSRuntime jsRuntime, SettingsManager settings, Model chatModel, Thread chatThread)
public Task<IList<Model>> GetTextModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default) => Task.FromResult<IList<Model>>(new List<Model>());
public Task<IList<Model>> GetImageModels(IJSRuntime jsRuntime, SettingsManager settings, CancellationToken token = default) => Task.FromResult<IList<Model>>(new List<Model>());
public async IAsyncEnumerable<string> StreamChatCompletion(IJSRuntime jsRuntime, SettingsManager settings, Model chatModel, ChatThread chatChatThread, [EnumeratorCancellation] CancellationToken token = default)
{
await Task.CompletedTask;
yield return "";
await Task.FromResult(0);
yield break;
}
public Task<IList<Model>> GetModels(IJSRuntime jsRuntime, SettingsManager settings) => Task.FromResult<IList<Model>>(new List<Model>());
public async IAsyncEnumerable<ImageURL> StreamImageCompletion(IJSRuntime jsRuntime, SettingsManager settings, Model imageModel, string promptPositive, string promptNegative = FilterOperator.String.Empty, ImageURL referenceImageURL = default, [EnumeratorCancellation] CancellationToken token = default)
{
await Task.FromResult(0);
yield break;
}
#endregion
}