45d3ee1ed6
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.
19 lines
451 B
C#
19 lines
451 B
C#
using Microsoft.Extensions.AI;
|
|
|
|
namespace Luna.Providers.Abstractions;
|
|
|
|
public interface IProvider
|
|
{
|
|
public static virtual string Name { get; } = null!;
|
|
|
|
public sealed IChatClient GetChatClient(string modelId)
|
|
{
|
|
var client = CreateChatClient(modelId);
|
|
|
|
return new ChatClientBuilder(client)
|
|
.UseFunctionInvocation()
|
|
.Build();
|
|
}
|
|
|
|
protected IChatClient CreateChatClient(string model);
|
|
} |