AuthorBuddy/Services/ILLMBackend.cs

23 lines
981 B
C#
Raw Normal View History

2026-05-31 19:31:27 +02:00
using AuthorBuddy.Web.Models;
namespace AuthorBuddy.Web.Services;
public interface ILLMBackend
{
string Name { get; }
bool SupportsModelManagement { get; }
Task<bool> TestConnectionAsync();
Task<IEnumerable<LLM_Model>> GetModelsAsync();
Task<string> ChatAsync(string model, string prompt, string? systemPrompt = null, double? temperature = null);
Task ChatStreamAsync(string model, string prompt, Func<string, Task> onToken, string? systemPrompt = null, double? temperature = null);
Task<float[]> GetEmbeddingAsync(string text, string? model = null);
Task<bool> PullModelAsync(string name, IProgress<string>? progress = null);
Task<bool> DeleteModelAsync(string name);
Task<int?> GetContextSizeAsync(string model);
Task<long> MeasureLatencyAsync(string model);
Task<bool> ModelExistsAsync(string model);
Task<(bool Success, int ContextWindow)> GetModelContextWindowAsync(string model);
bool TestEmbedding(string model);
}