Implement configuration system with embedded TOML resources for agent and provider definitions, custom IConfigurationSource/Provider for agent and provider options, and DI extension methods. Includes config models for agents, providers, sessions, and Telegram integration.
14 lines
445 B
C#
14 lines
445 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace Luna.Configuration.Services.Providers;
|
|
|
|
internal class ProviderOptionsConfigurationSource(string? searchPath = null)
|
|
: IConfigurationSource
|
|
{
|
|
private readonly ProviderOptionsProvider optionsProvider = new(searchPath);
|
|
|
|
public IConfigurationProvider Build(IConfigurationBuilder builder)
|
|
=> new ProviderOptionsConfigurationProvider(optionsProvider.GetProviderOptions());
|
|
}
|
|
|