From e4569be9c6eb27e9dc203ee18a53587d34a7267d Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Mon, 8 Jan 2024 12:06:13 -0600 Subject: [PATCH] Test Azure App Service. --- Directory.Build.props | 3 +- .../Repositories/BotSharpDatabaseSettings.cs | 1 - .../BotSharp.Logger/BotSharp.Logger.csproj | 43 ++-------------- .../BotSharp.OpenAPI/BotSharp.OpenAPI.csproj | 10 +++- .../Controllers/ApplicationController.cs | 7 +++ .../BotSharp.Plugin.ChatHub.csproj | 8 ++- src/WebStarter/Program.cs | 4 +- src/WebStarter/WebStarter.csproj | 51 +++++++++---------- src/WebStarter/appsettings.json | 14 ----- 9 files changed, 53 insertions(+), 88 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index f85831ff..69c26286 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,8 +2,7 @@ net6.0 10.0 - ..\..\..\packages 0.21.0 - true + false \ No newline at end of file diff --git a/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs b/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs index 9bc9ce52..458aa83e 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Repositories/BotSharpDatabaseSettings.cs @@ -16,7 +16,6 @@ public class DatabaseBasicSettings public bool EnableSqlLog { get; set; } public bool EnableSensitiveDataLogging { get; set; } public bool EnableRetryOnFailure { get; set; } - public bool UseCamelCase { get; set; } } public class DbConnectionSetting diff --git a/src/Infrastructure/BotSharp.Logger/BotSharp.Logger.csproj b/src/Infrastructure/BotSharp.Logger/BotSharp.Logger.csproj index 417d91fe..324db6cf 100644 --- a/src/Infrastructure/BotSharp.Logger/BotSharp.Logger.csproj +++ b/src/Infrastructure/BotSharp.Logger/BotSharp.Logger.csproj @@ -1,56 +1,21 @@ - netstandard2.1 + net6.0 + enable + enable $(LangVersion) $(BotSharpVersion) $(GeneratePackageOnBuild) - - Haiping Chen - SciSharp STACK - LL Application Framework - - Open source LLM application framework to build scalable, flexible and robust AI system. - - git - https://github.com/SciSharp/BotSharp - Chatbot, Bot, LLM, AI, ChatGPT, OpenAI - Support dialogue status tracking. - Since 2018 Haiping Chen - https://github.com/SciSharp/BotSharp - https://raw.githubusercontent.com/SciSharp/BotSharp/master/docs/static/logos/BotSharp.png - https://raw.githubusercontent.com/SciSharp/BotSharp/master/LICENSE - Icon.png - enable - - - - TRACE;DEBUG - 1701;1702 - - - - TRACE; - 1701;1702 - - - - 1701;1702 - - - - 1701;1702 - - True \ - + diff --git a/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj b/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj index aae65f9a..a5166571 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj +++ b/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -9,6 +9,13 @@ $(GeneratePackageOnBuild) + + + True + \ + + + @@ -16,7 +23,6 @@ - diff --git a/src/Infrastructure/BotSharp.OpenAPI/Controllers/ApplicationController.cs b/src/Infrastructure/BotSharp.OpenAPI/Controllers/ApplicationController.cs index 1c8b9cbf..201e5ef3 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/Controllers/ApplicationController.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/Controllers/ApplicationController.cs @@ -12,6 +12,13 @@ public class ApplicationController : ControllerBase _services = services; } + [AllowAnonymous] + [HttpGet("/app/health")] + public IActionResult Health() + { + return Ok(new { }); + } + [HttpGet("/app/shutdown")] public IActionResult Restart() { diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj b/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj index 34a924d4..d2561751 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj +++ b/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj @@ -7,9 +7,15 @@ $(LangVersion) $(BotSharpVersion) $(GeneratePackageOnBuild) - $(GenerateDocumentationFile) + + + True + \ + + + diff --git a/src/WebStarter/Program.cs b/src/WebStarter/Program.cs index 5aa02e01..8c0634e1 100644 --- a/src/WebStarter/Program.cs +++ b/src/WebStarter/Program.cs @@ -51,9 +51,9 @@ builder.Services.AddSignalR(); var app = builder.Build(); // Configure the HTTP request pipeline. +app.UseSwagger(); if (app.Environment.IsDevelopment()) { - app.UseSwagger(); app.UseSwaggerUI(); } @@ -68,9 +68,7 @@ app.MapControllers(); // Use BotSharp app.UseBotSharp(); -#if DEBUG app.UseCors("MyCorsPolicy"); -#endif // Host BotSharp UI built in adapter-static app.UseFileServer(); diff --git a/src/WebStarter/WebStarter.csproj b/src/WebStarter/WebStarter.csproj index 4cd0482e..ab3e2566 100644 --- a/src/WebStarter/WebStarter.csproj +++ b/src/WebStarter/WebStarter.csproj @@ -6,20 +6,8 @@ enable InProcess 4fb8c9df-7975-4926-ba73-46c8ca440691 - False - - - - - - - - - - - @@ -27,20 +15,38 @@ - - - + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + - - + + + + + @@ -53,10 +59,8 @@ - - @@ -64,16 +68,11 @@ - - - + + - - - - diff --git a/src/WebStarter/appsettings.json b/src/WebStarter/appsettings.json index 915017a5..d15ac9bd 100644 --- a/src/WebStarter/appsettings.json +++ b/src/WebStarter/appsettings.json @@ -119,7 +119,6 @@ "Slavers": [] }, "FileRepository": "data", - "UseCamelCase": true, "Assemblies": [ "BotSharp.Core" ] }, @@ -138,12 +137,8 @@ "KnowledgeBase": { "VectorDb": "MemVectorDatabase", - // "VectorDb": "QdrantDb", "TextEmbedding": "fastTextEmbeddingProvider", - // "TextEmbedding": "LLamaSharp.TextEmbeddingProvider", "TextCompletion": "AzureOpenAI.Providers.TextCompletionProvider", - // "TextCompletion": "LLamaSharp.TextCompletionProvider", - // "Pdf2TextConverter": "PaddleSharp.Providers.Pdf2TextConverter" "Pdf2TextConverter": "PigPdf2TextConverter" }, @@ -151,24 +146,15 @@ "Assemblies": [ "BotSharp.Plugin.MongoStorage", "BotSharp.Core", - "BotSharp.Logger", "BotSharp.Plugin.AzureOpenAI", "BotSharp.Plugin.GoogleAI", "BotSharp.Plugin.MetaAI", "BotSharp.Plugin.MetaMessenger", - // "BotSharp.Plugin.Twilio", "BotSharp.Plugin.HuggingFace", - "BotSharp.Plugin.LLamaSharp", - // "BotSharp.Plugin.SemanticKernel", "BotSharp.Plugin.KnowledgeBase", "BotSharp.Plugin.Qdrant", - "BotSharp.Plugin.PaddleSharp", "BotSharp.Plugin.ChatHub", "BotSharp.Plugin.WeChat", - // "BotSharp.Plugin.TelegramBots", - // "BotSharp.Plugin.RoutingSpeeder", - "BotSharp.Plugin.WebDriver", - "BotSharp.Plugin.HttpHandler", "BotSharp.Plugin.PizzaBot" ] }