diff --git a/infra/modules/ca-chat/main.tf b/infra/modules/ca-chat/main.tf index 4a7eb2c..99df5f6 100644 --- a/infra/modules/ca-chat/main.tf +++ b/infra/modules/ca-chat/main.tf @@ -89,10 +89,20 @@ resource "azapi_resource" "ca_back" { { name = "AZURE_CLIENT_ID" value = "${var.managed_identity_client_id}" - }, - { - name = "APP_LOG_LEVEL" - value = "DEBUG" + }, + { + name = "APP_LOG_LEVEL" + value = "DEBUG" + }, + { + name = "DEFAULT_QUESTIONS" + value = jsonencode([ + "Make me a summary of the document", + "Get me the most relevant topics of the document", + "Explain the document for a CEO", + "Explain the document for a kid", + "Translate the main topics of the document to X language" + ]) } ], }, diff --git a/src/AIHub/Controllers/ChatOnYourDataController.cs b/src/AIHub/Controllers/ChatOnYourDataController.cs index 832729b..fc27ed8 100644 --- a/src/AIHub/Controllers/ChatOnYourDataController.cs +++ b/src/AIHub/Controllers/ChatOnYourDataController.cs @@ -3,15 +3,23 @@ namespace MVCWeb.Controllers; public class ChatOnYourDataController : Controller { private readonly ILogger _logger; + private readonly IConfiguration _configuration; - public ChatOnYourDataController(ILogger logger) + public ChatOnYourDataController(ILogger logger, IConfiguration configuration) { _logger = logger; + _configuration = configuration; } public IActionResult ChatOnYourData() { - return View(); + var model = new ChatOnYourDataModel + { + Link = _configuration.GetValue("ChatOnYourData:Link") ?? string.Empty, + DefaultQuestions = _configuration.GetSection("ChatOnYourData:DefaultQuestions").Get>() ?? new List() + }; + + return View(model); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] diff --git a/src/AIHub/Models/ChatOnYourDataModel.cs b/src/AIHub/Models/ChatOnYourDataModel.cs new file mode 100644 index 0000000..19c7577 --- /dev/null +++ b/src/AIHub/Models/ChatOnYourDataModel.cs @@ -0,0 +1,7 @@ +namespace MVCWeb.Models; + +public class ChatOnYourDataModel +{ + public string Link { get; set; } = string.Empty; + public List DefaultQuestions { get; set; } = new List(); +} \ No newline at end of file diff --git a/src/AIHub/Views/ChatOnYourData/ChatOnYourData.cshtml b/src/AIHub/Views/ChatOnYourData/ChatOnYourData.cshtml index 6199513..85eaa53 100644 --- a/src/AIHub/Views/ChatOnYourData/ChatOnYourData.cshtml +++ b/src/AIHub/Views/ChatOnYourData/ChatOnYourData.cshtml @@ -1,4 +1,4 @@ -@inject IConfiguration Configuration +@model ChatOnYourDataModel @{ ViewData["Title"] = "Chat On Your Data"; } @@ -25,9 +25,34 @@
+ @if (Model.DefaultQuestions != null && Model.DefaultQuestions.Any()) + { +
+
+
Suggested Questions
+

Try these sample questions to get started with your document analysis:

+
+ @foreach (var question in Model.DefaultQuestions) + { +
+
+
+ +
+
+
+ } +
+
+
+ }
- +
@@ -38,3 +63,58 @@
+ + + + \ No newline at end of file diff --git a/src/AIHub/appsettings.Development.json b/src/AIHub/appsettings.Development.json index 0c208ae..dc4a2dc 100644 --- a/src/AIHub/appsettings.Development.json +++ b/src/AIHub/appsettings.Development.json @@ -4,5 +4,15 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "ChatOnYourData": { + "Link": "http://localhost:5000", + "DefaultQuestions": [ + "Make me a summary of the document", + "Get me the most relevant topics of the document", + "Explain the document for a CEO", + "Explain the document for a kid", + "Translate the main topics of the document to X language" + ] } } diff --git a/src/AIHub/appsettings.template.json b/src/AIHub/appsettings.template.json index ac52ec5..2a39a13 100644 --- a/src/AIHub/appsettings.template.json +++ b/src/AIHub/appsettings.template.json @@ -60,7 +60,14 @@ "DeploymentName": "gpt-4" }, "ChatOnYourData": { - "Link": "" + "Link": "", + "DefaultQuestions": [ + "Make me a summary of the document", + "Get me the most relevant topics of the document", + "Explain the document for a CEO", + "Explain the document for a kid", + "Translate the main topics of the document to X language" + ] }, "Storage": { "ConnectionString": "",