2024-04-20 15:06:50 +00:00
|
|
|
using AIStudio.Settings;
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
|
|
|
|
namespace AIStudio.Provider;
|
|
|
|
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// A common interface for all providers.
|
|
|
|
/// </summary>
|
2024-04-20 15:06:50 +00:00
|
|
|
public interface IProvider
|
|
|
|
{
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The provider's ID.
|
|
|
|
/// </summary>
|
2024-04-20 15:06:50 +00:00
|
|
|
public string Id { get; }
|
|
|
|
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The provider's instance name. Useful for multiple instances of the same provider,
|
|
|
|
/// e.g., to distinguish between different OpenAI API keys.
|
|
|
|
/// </summary>
|
2024-04-20 15:06:50 +00:00
|
|
|
public string InstanceName { get; set; }
|
|
|
|
|
|
|
|
public IAsyncEnumerable<string> GetChatCompletion(IJSRuntime jsRuntime, SettingsManager settings, Model chatModel, Thread chatThread);
|
|
|
|
|
|
|
|
public Task<IList<Model>> GetModels(IJSRuntime jsRuntime, SettingsManager settings);
|
|
|
|
}
|