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 741 B

1234567891011121314151617181920212223242526272829303132
  1. using LLama.WebAPI.Services;
  2. var builder = WebApplication.CreateBuilder(args);
  3. // Add services to the container.
  4. builder.Services.AddControllers();
  5. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  6. builder.Services.AddEndpointsApiExplorer();
  7. builder.Services.AddSwaggerGen();
  8. builder.Services.AddSingleton<StatefulChatService>();
  9. builder.Services.AddScoped<StatelessChatService>();
  10. var app = builder.Build();
  11. app.UseRouting();
  12. // Configure the HTTP request pipeline.
  13. if (app.Environment.IsDevelopment())
  14. {
  15. app.UseSwagger();
  16. app.UseSwaggerUI();
  17. }
  18. app.UseAuthorization();
  19. app.UseEndpoints(endpoints =>
  20. {
  21. _ = endpoints.MapControllers();
  22. });
  23. app.Run();