📄 src/Reviewer.Cli/FoundryLocal/FoundryLocalServiceCollectionExtensions.cs
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;

namespace Reviewer.Cli.FoundryLocal;

internal static class FoundryLocalServiceCollectionExtensions
{
    extension(IServiceCollection services)
    {
        public IServiceCollection AddFoundryLocal()
        {
            services
                .AddOptions<FoundryLocalOptions>()
                .BindConfiguration("FoundryLocal")
                .Validate<FoundryLocalOptionsValidator>()
                .ValidateOnStart();
            services.AddSingleton<IChatClient, FoundryLocalChatClient>();
            return services;
        }
    }
}