bc25dc7b07
Implement the core application server as an ASP.NET web host with: - SignalR ChatHub for real-time client communication - Session management with token estimation for context windowing - Extensible tool system with attribute-based tool discovery - Chat stream update builder for streaming AI responses - App configuration with appsettings for development and production
19 lines
589 B
C#
19 lines
589 B
C#
namespace Luna.Core.Tools.Extensions;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
extension(IServiceCollection services)
|
|
{
|
|
public IServiceCollection AddTools()
|
|
{
|
|
services.AddSingleton<IToolsProvider, ToolsProvider>();
|
|
|
|
typeof(ToolsProvider).Assembly.GetTypes()
|
|
.Where(t => typeof(IToolbox).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract)
|
|
.ToList()
|
|
.ForEach(t => services.AddTransient(typeof(IToolbox), t));
|
|
|
|
return services;
|
|
}
|
|
}
|
|
} |