From ab94e0b55edbc6142095c9047d05eea89bcf4648 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 4 Feb 2025 10:24:13 -0800 Subject: [PATCH] Small fixes for chat template (#5839) --- src/ProjectTemplates/.gitignore | 3 ++ .../.template.config/dotnetcli.host.json | 14 +++++ .../.template.config/template.json | 54 +++++++++++++++++-- .../Properties/launchSettings.json | 23 ++++++++ .../ChatWithCustomData.Web/Tailwind.targets | 10 ++-- 5 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/dotnetcli.host.json create mode 100644 src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Properties/launchSettings.json diff --git a/src/ProjectTemplates/.gitignore b/src/ProjectTemplates/.gitignore index 74832506557..22b26761348 100644 --- a/src/ProjectTemplates/.gitignore +++ b/src/ProjectTemplates/.gitignore @@ -5,3 +5,6 @@ package-lock.json */src/**/*.csproj + +# launchSettings.json files are required for the templates. +!launchSettings.json diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/dotnetcli.host.json b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/dotnetcli.host.json new file mode 100644 index 00000000000..16e02d30dfd --- /dev/null +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/dotnetcli.host.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "kestrelHttpPort": { + "isHidden": true + }, + "kestrelHttpsPort": { + "isHidden": true + } + }, + "usageExamples": [ + "" + ] +} diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json index f2d494f5f64..b090af40147 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json @@ -29,7 +29,7 @@ } ] }], - "symbols":{ + "symbols": { "framework": { "type": "parameter", "description": "The target framework for the project.", @@ -145,14 +145,14 @@ "description": "Model/deployment for embeddings. Example: text-embedding-3-small" }, "OpenAiChatModelDefault": { - "type": "generated", + "type": "generated", "generator": "constant", "parameters": { "value": "gpt-4o-mini" } }, "OpenAiEmbeddingModelDefault": { - "type": "generated", + "type": "generated", "generator": "constant", "parameters": { "value": "text-embedding-3-small" @@ -177,14 +177,14 @@ "replaces": "text-embedding-3-small" }, "OllamaChatModelDefault": { - "type": "generated", + "type": "generated", "generator": "constant", "parameters": { "value": "llama3.1" } }, "OllamaEmbeddingModelDefault": { - "type": "generated", + "type": "generated", "generator": "constant", "parameters": { "value": "all-minilm" @@ -207,6 +207,50 @@ "fallbackVariableName": "OllamaEmbeddingModelDefault" }, "replaces": "all-minilm" + }, + "kestrelHttpPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the HTTP endpoint in launchSettings.json." + }, + "kestrelHttpPortGenerated": { + "type": "generated", + "generator": "port", + "parameters": { + "low": 5000, + "high": 5300 + } + }, + "kestrelHttpPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "kestrelHttpPort", + "fallbackVariableName": "kestrelHttpPortGenerated" + }, + "replaces": "5000" + }, + "kestrelHttpsPort": { + "type": "parameter", + "datatype": "integer", + "description": "Port number to use for the HTTPS endpoint in launchSettings.json." + }, + "kestrelHttpsPortGenerated": { + "type": "generated", + "generator": "port", + "parameters": { + "low": 7000, + "high": 7300 + } + }, + "kestrelHttpsPortReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "kestrelHttpsPort", + "fallbackVariableName": "kestrelHttpsPortGenerated" + }, + "replaces": "5001" } } } diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Properties/launchSettings.json b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Properties/launchSettings.json new file mode 100644 index 00000000000..900ff92f972 --- /dev/null +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Tailwind.targets b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Tailwind.targets index 3312cef35d0..b9b47c7f370 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Tailwind.targets +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData.Web/Tailwind.targets @@ -9,10 +9,12 @@ Exclude="$(IntermediateOutputPath)\**; $(TailwindCssOutput)" /> - +