Add provider abstraction layer with Mistral and Ollama implementations
Define IProvider interface and implement concrete providers for Mistral (with custom DTOs for chat completion API) and Ollama (via OllamaSharp). Includes DI registration extensions using Microsoft.Extensions.AI.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Luna.Providers.Abstractions;
|
||||
using Microsoft.Extensions.AI;
|
||||
using OllamaSharp;
|
||||
|
||||
namespace Luna.Providers.Ollama;
|
||||
|
||||
public sealed class OllamaProvider(IHttpClientFactory httpClientFactory) : IProvider
|
||||
{
|
||||
public static string Name => "Ollama";
|
||||
|
||||
public IChatClient CreateChatClient(string model)
|
||||
=> new OllamaApiClient(httpClientFactory.CreateClient(Name), model);
|
||||
}
|
||||
Reference in New Issue
Block a user