AuthorBuddy/Services/IOllamaService.cs
2026-05-31 19:31:27 +02:00

22 lines
1,004 B
C#

using AuthorBuddy.Web.Models;
namespace AuthorBuddy.Web.Services;
public interface IOllamaService
{
Task<IEnumerable<LLM_Model>> GetLocalModelsAsync();
Task<bool> PullModelAsync(string modelName, IProgress<string> progress);
Task<string> QuickSpellCheckAsync(string text);
Task<float[]> GetEmbeddingAsync(string text);
Task<bool> TestEmbeddingAsync(string model);
Task<string> Chat(string model, string userMessage, string? systemPrompt = null, double? temperature = null);
Task ChatStream(string model, string userMessage, Func<string, Task> onToken, string? systemPrompt = null, double? temperature = null);
Task<string> AnswerBasedOnFactsAsync(string question, string facts);
Task<(bool Success, long LatencyMs)> TestConnectionAsync();
Task<bool> ModelExistsAsync(string model);
Task<(bool Success, int ContextWindow)> GetModelContextWindowAsync(string model);
Task<long> MeasureLatencyAsync(string model);
void Reconfigure(string ollamaUrl);
}