You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Program.cs 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using LLama.Web.Common;
  2. using LLama.Web.Hubs;
  3. using LLama.Web.Services;
  4. namespace LLama.Web
  5. {
  6. public class Program
  7. {
  8. public static void Main(string[] args)
  9. {
  10. var builder = WebApplication.CreateBuilder(args);
  11. // Add services to the container.
  12. builder.Services.AddRazorPages();
  13. builder.Services.AddSignalR();
  14. // Load InteractiveOptions
  15. builder.Services.AddOptions<LLamaOptions>()
  16. .PostConfigure(x => x.Initialize())
  17. .BindConfiguration(nameof(LLamaOptions));
  18. // Services DI
  19. builder.Services.AddSingleton<IModelSessionService, ModelSessionService>();
  20. var app = builder.Build();
  21. // Configure the HTTP request pipeline.
  22. if (!app.Environment.IsDevelopment())
  23. {
  24. app.UseExceptionHandler("/Error");
  25. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
  26. app.UseHsts();
  27. }
  28. app.UseHttpsRedirection();
  29. app.UseStaticFiles();
  30. app.UseRouting();
  31. app.UseAuthorization();
  32. app.MapRazorPages();
  33. app.MapHub<InteractiveHub>(nameof(InteractiveHub));
  34. app.Run();
  35. }
  36. }
  37. }