2023-05-27 01:58:31 +00:00
|
|
|
using BotSharp.Core;
|
|
|
|
|
|
2023-05-26 01:36:15 +00:00
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
|
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
|
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
|
|
|
|
|
builder.Services.AddHttpContextAccessor();
|
|
|
|
|
|
2023-05-27 01:58:31 +00:00
|
|
|
// Add BotSharp
|
|
|
|
|
builder.Services.AddBotSharp();
|
2023-05-28 16:30:27 +00:00
|
|
|
// builder.Services.AddLlamaSharp(builder.Configuration);
|
|
|
|
|
builder.Services.AddAzureOpenAi(builder.Configuration);
|
2023-05-26 01:36:15 +00:00
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
|
|
|
{
|
|
|
|
|
app.UseSwagger();
|
|
|
|
|
app.UseSwaggerUI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
2023-05-27 01:58:31 +00:00
|
|
|
// Use BotSharp
|
|
|
|
|
app.UseBotSharp();
|
|
|
|
|
|
2023-05-26 01:36:15 +00:00
|
|
|
app.Run();
|