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

2 years ago
2 years ago
12345678910111213141516171819202122232425262728
  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. // Configure the HTTP request pipeline.
  12. if (app.Environment.IsDevelopment())
  13. {
  14. app.UseSwagger();
  15. app.UseSwaggerUI();
  16. }
  17. app.UseAuthorization();
  18. app.MapControllers();
  19. app.Run();