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.
12 lines
428 B
C#
12 lines
428 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace Luna.Configuration.Services.Agents;
|
|
|
|
internal class AgentOptionsConfigurationSource(string? searchPath = null)
|
|
: IConfigurationSource
|
|
{
|
|
private readonly AgentOptionsProvider optionsProvider = new(searchPath);
|
|
|
|
public IConfigurationProvider Build(IConfigurationBuilder builder)
|
|
=> new AgentOptionsConfigurationProvider(optionsProvider.GetAgentOptions());
|
|
} |