using System; using Microsoft.Extensions.DependencyInjection; namespace Radzen; /// /// Extension methods for configuring AIChatService in the dependency injection container. /// public static class AIChatServiceExtensions { /// /// Adds the AIChatService to the service collection with the specified configuration. /// /// The service collection. /// The action to configure the AIChatService options. /// The updated service collection. public static IServiceCollection AddAIChatService(this IServiceCollection services, Action configureOptions) { ArgumentNullException.ThrowIfNull(services); ArgumentNullException.ThrowIfNull(configureOptions); services.Configure(configureOptions); services.AddScoped(); return services; } /// /// Adds the AIChatService to the service collection with default options. /// /// The service collection. /// The updated service collection. public static IServiceCollection AddAIChatService(this IServiceCollection services) { services.AddOptions(); services.AddScoped(); return services; } }