diff --git a/dockerfiles/.env b/dockerfiles/.env new file mode 100644 index 00000000..9e5f5f8a --- /dev/null +++ b/dockerfiles/.env @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dockerfiles/ARTICULATE.Dockerfile b/dockerfiles/ARTICULATE.Dockerfile deleted file mode 100644 index e4c684f2..00000000 --- a/dockerfiles/ARTICULATE.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# stage 1: build -FROM microsoft/dotnet AS botsharp-articulate -WORKDIR /source - -# copies the rest of your code -COPY . . - -# RUN dotnet build -RUN dotnet publish BotSharp.WebHost/BotSharp.WebHost.csproj --configuration ARTICULATE --output /app - -# copy Settings folder -WORKDIR /app -RUN mkdir App_Data/Projects - -# stage 2: run -ENTRYPOINT [ "dotnet", "BotSharp.WebHost.dll" ] diff --git a/dockerfiles/DIALOGFLOW.Dockerfile b/dockerfiles/DIALOGFLOW.Dockerfile deleted file mode 100644 index 716defb9..00000000 --- a/dockerfiles/DIALOGFLOW.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# stage 1: build -FROM microsoft/dotnet AS botsharp-dialogflow -WORKDIR /source - -# copies the rest of your code -COPY . . - -# RUN dotnet build -RUN dotnet publish BotSharp.WebHost/BotSharp.WebHost.csproj --configuration DIALOGFLOW --output /app - -# copy Settings folder -WORKDIR /app -RUN mkdir App_Data/Projects - -# stage 2: run -ENTRYPOINT [ "dotnet", "BotSharp.WebHost.dll" ] diff --git a/dockerfiles/RASA.Dockerfile b/dockerfiles/RASA.Dockerfile deleted file mode 100644 index c9a5b707..00000000 --- a/dockerfiles/RASA.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# stage 1: build -FROM microsoft/dotnet AS botsharp-rasa -WORKDIR /source - -# copies the rest of your code -COPY . . - -# RUN dotnet build -RUN dotnet publish BotSharp.WebHost/BotSharp.WebHost.csproj --configuration RASA --output /app - -# copy Settings folder -WORKDIR /app -RUN mkdir App_Data/Projects - -# stage 2: run -ENTRYPOINT [ "dotnet", "BotSharp.WebHost.dll" ] diff --git a/dockerfiles/Dockerfile b/dockerfiles/WebStarter.Dockerfile similarity index 100% rename from dockerfiles/Dockerfile rename to dockerfiles/WebStarter.Dockerfile diff --git a/dockerfiles/appsettings.json b/dockerfiles/appsettings.json new file mode 100644 index 00000000..380008ef --- /dev/null +++ b/dockerfiles/appsettings.json @@ -0,0 +1,158 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + + "Jwt": { + "Issuer": "botsharp", + "Audience": "botsharp", + "Key": "31ba6052aa6f4569901facc3a41fcb4a" + }, + + "LlmProviders": [ + { + "Provider": "azure-openai", + "Models": [ + { + "Name": "gpt-35-turbo", + "ApiKey": "", + "Endpoint": "https://ai4c-demo.openai.azure.com/", + "Type": "chat", + "PromptCost": 0.0015, + "CompletionCost": 0.002 + }, + { + "Name": "gpt-35-turbo", + "ApiKey": "", + "Endpoint": "https://ai4c-demo.openai.azure.com/", + "Type": "text", + "PromptCost": 0.0015, + "CompletionCost": 0.002 + } + ] + } + ], + + "Router": { + }, + + "Evaluator": { + "AgentId": "dfd9b46d-d00c-40af-8a75-3fbdc2b89869" + }, + + "Agent": { + "DataDir": "agents", + "TemplateFormat": "liquid", + "HostAgentId": "01e2fc5c-2c89-4ec7-8470-7688608b496c", + "LlmConfig": { + "Provider": "azure-openai", + "Model": "gpt-35-turbo" + } + }, + + "Conversation": { + "DataDir": "conversations", + "ShowVerboseLog": false, + "EnableLlmCompletionLog": false, + "EnableExecutionLog": true + }, + + "LlamaSharp": { + "Interactive": true, + "ModelDir": "C:/Users/haipi/Downloads", + "DefaultModel": "llama-2-7b-chat.Q8_0.gguf", + "MaxContextLength": 1024, + "NumberOfGpuLayer": 20 + }, + + "AzureOpenAi": { + }, + + "GoogleAi": { + "PaLM": { + "Endpoint": "https://generativelanguage.googleapis.com", + "ApiKey": "" + } + }, + + "HuggingFace": { + "Endpoint": "https://api-inference.huggingface.co", + "Model": "tiiuae/falcon-180B-chat", + "Token": "" + }, + + "MetaAi": { + "fastText": { + "ModelPath": "dbpedia.ftz" + } + }, + + "RoutingSpeeder": { + }, + + "MetaMessenger": { + "Endpoint": "https://graph.facebook.com", + "ApiVersion": "v17.0", + "PageId": "", + "PageAccessToken": "" + }, + + "Twilio": { + "PhoneNumber": "+1", + "AccountSID": "", + "AuthToken": "", + "CallbackHost": "https://", + "AgentId": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a" + }, + + "Database": { + "Default": "FileRepository", + "TablePrefix": "BotSharp", + "BotSharpMongoDb": "", + "FileRepository": "data", + "Assemblies": [ "BotSharp.Core" ] + }, + + "Qdrant": { + "Url": "", + "ApiKey": "" + }, + + "WeChat": { + "AgentId": "437bed34-1169-4833-95ce-c24b8b56154a", + "Token": "#{Token}#", + "EncodingAESKey": "#{EncodingAESKey}#", + "WeixinAppId": "#{WeixinAppId}#", + "WeixinAppSecret": "#{WeixinAppSecret}#" + }, + + "KnowledgeBase": { + "VectorDb": "MemVectorDatabase", + "TextEmbedding": "fastTextEmbeddingProvider", + "TextCompletion": "AzureOpenAI.Providers.TextCompletionProvider", + "Pdf2TextConverter": "PigPdf2TextConverter" + }, + + "PluginLoader": { + "Assemblies": [ + "BotSharp.Plugin.MongoStorage", + "BotSharp.Core", + "BotSharp.Plugin.AzureOpenAI", + "BotSharp.Plugin.GoogleAI", + "BotSharp.Plugin.MetaAI", + "BotSharp.Plugin.MetaMessenger", + "BotSharp.Plugin.HuggingFace", + "BotSharp.Plugin.KnowledgeBase", + "BotSharp.Plugin.Qdrant", + "BotSharp.Plugin.ChatHub", + "BotSharp.Plugin.WeChat", + "BotSharp.Plugin.PizzaBot", + "BotSharp.Plugin.WebDriver", + "BotSharp.Plugin.LLamaSharp" + ] + } +} diff --git a/dockerfiles/docker-compose-articulateui-0.1.0.yml b/dockerfiles/docker-compose-articulateui-0.1.0.yml deleted file mode 100644 index 7e3c9142..00000000 --- a/dockerfiles/docker-compose-articulateui-0.1.0.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3.0' - -services: - ui: - image: botsharpdocker/botsharp-articulateui:0.1.0 - ports: ['0.0.0.0:3000:3000'] - networks: ['botsharp-network'] - environment: - - rasanluendpoint=http://botsharp:7500 - - botsharp: - image: botsharpdocker/botsharp-articulate:0.1.0 - ports: ['0.0.0.0:7500:7500'] - networks: ['botsharp-network'] - - -networks: {botsharp-network: {}} diff --git a/dockerfiles/docker-compose-articulateui.yml b/dockerfiles/docker-compose-articulateui.yml deleted file mode 100644 index 276c443f..00000000 --- a/dockerfiles/docker-compose-articulateui.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: '3.0' - -services: - ui: - image: samtecspg/articulate-ui:0.12.1 - ports: ['0.0.0.0:3000:3000'] - networks: ['botsharp-network'] - environment: - - API_URL - - api: - image: samtecspg/articulate-api:0.12.1 - ports: ['0.0.0.0:7500:7500'] - networks: ['botsharp-network'] - entrypoint: ['node', 'start.js'] - environment: - - SWAGGER_BASE_PATH - - botsharp: - image: botsharpdocker/botsharp-rasa:latest - ports: ['0.0.0.0:5000:5000'] - networks: ['botsharp-network'] - -networks: {botsharp-network: {}} diff --git a/dockerfiles/docker-compose-core.yml b/dockerfiles/docker-compose-core.yml deleted file mode 100644 index dc5c6c77..00000000 --- a/dockerfiles/docker-compose-core.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.0' - -services: - botsharp: - image: botsharpdocker/botsharp-core:0.2.0 - ports: ['0.0.0.0:3112:3112'] - networks: ['botsharp-network'] - -networks: {botsharp-network: {}} diff --git a/dockerfiles/docker-compose-rasaui.yml b/dockerfiles/docker-compose-rasaui.yml deleted file mode 100644 index 8248c0d7..00000000 --- a/dockerfiles/docker-compose-rasaui.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3.0' - -services: - ui: - image: botsharpdocker/botsharp-rasaui:latest - ports: ['0.0.0.0:5001:5001'] - networks: ['botsharp-network'] - environment: - - rasanluendpoint=http://botsharp:5000 - - botsharp: - image: botsharpdocker/botsharp-rasa:latest - ports: ['0.0.0.0:5000:5000'] - networks: ['botsharp-network'] - - -networks: {botsharp-network: {}} diff --git a/dockerfiles/docker-compose.yml b/dockerfiles/docker-compose.yml new file mode 100644 index 00000000..983979a7 --- /dev/null +++ b/dockerfiles/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.0' + +services: + botsharp: + image: botsharpdocker/botsharp-core:0.23 + build: + context: ../ + dockerfile: dockerfiles/WebStarter.Dockerfile + ports: + - 5015:5015 + env_file: + - ./.env + volumes: + - ./appsettings.json:/app/appsettings.json + networks: ['botsharp-network'] + +networks: {botsharp-network: {}} diff --git a/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj b/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj index 3223688a..e1bf2e4c 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj +++ b/src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj @@ -1,7 +1,7 @@ - net8.0 + net8.0 enable enable $(LangVersion) @@ -16,16 +16,20 @@ \ - - - - + + + + - + + + + + diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj b/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj index af5b2146..52358e1d 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj +++ b/src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj @@ -16,12 +16,9 @@ \ - - - - + diff --git a/src/Plugins/BotSharp.Plugin.ChatbotUI/BotSharp.Plugin.ChatbotUI.csproj b/src/Plugins/BotSharp.Plugin.ChatbotUI/BotSharp.Plugin.ChatbotUI.csproj index 8f70adb1..4d529420 100644 --- a/src/Plugins/BotSharp.Plugin.ChatbotUI/BotSharp.Plugin.ChatbotUI.csproj +++ b/src/Plugins/BotSharp.Plugin.ChatbotUI/BotSharp.Plugin.ChatbotUI.csproj @@ -11,6 +11,7 @@ + diff --git a/src/WebStarter/Program.cs b/src/WebStarter/Program.cs index fbe924a5..0bd669ac 100644 --- a/src/WebStarter/Program.cs +++ b/src/WebStarter/Program.cs @@ -24,7 +24,7 @@ builder.Host.UseSerilog(); builder.Services.AddBotSharpCore(builder.Configuration) .AddBotSharpOpenAPI(builder.Configuration, new[] { - "http://localhost:5015", + "http://0.0.0.0:5015", "https://botsharp.scisharpstack.org", "https://chat.scisharpstack.org" }, builder.Environment, true)