2026-05-16 16:13:35 +02:00
|
|
|
|
|
|
|
|
|
2026-05-14 12:31:35 +02:00
|
|
|
using AuthorBuddy.Web.Models;
|
|
|
|
|
|
|
|
|
|
namespace AuthorBuddy.Web.Services;
|
|
|
|
|
|
|
|
|
|
public interface IOllamaService
|
|
|
|
|
{
|
2026-05-16 16:13:35 +02:00
|
|
|
Task<IEnumerable<LLM_Model>> GetLocalModelsAsync();
|
|
|
|
|
Task<bool> PullModelAsync(string modelName, IProgress<string> progress);
|
2026-05-17 07:27:18 +02:00
|
|
|
Task<string> QuickSpellCheckAsync(string text);
|
2026-05-20 06:12:54 +02:00
|
|
|
Task<float[]> GetEmbeddingAsync(string text);
|
|
|
|
|
Task<bool> TestEmbeddingAsync(string model);
|
2026-05-31 19:31:27 +02:00
|
|
|
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);
|
2026-05-16 16:13:35 +02:00
|
|
|
void Reconfigure(string ollamaUrl);
|
2026-05-14 12:31:35 +02:00
|
|
|
}
|