aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <roy.mail.net@gmail.com>2025-09-03 00:06:46 +0300
committerRoy Ben Shabat <roy.mail.net@gmail.com>2025-09-03 00:06:46 +0300
commite91dd4d23647947b2c14787605b55400a405cff3 (patch)
treec1bb8fd60eb3923376573b63f8870e74f9828f5c /Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs
parent12184412615b52ae98cba57921a7586e6970c436 (diff)
downloadTango-e91dd4d23647947b2c14787605b55400a405cff3.tar.gz
Tango-e91dd4d23647947b2c14787605b55400a405cff3.zip
Twine AI.
Diffstat (limited to 'Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs')
-rw-r--r--Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs
index 35b170347..c204df7c7 100644
--- a/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs
+++ b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Controllers/ChatController.cs
@@ -1,11 +1,11 @@
using System.Data;
using System.Text.Json;
-using ChatADX.Web.Models;
-using ChatADX.Web.Services;
+using Tango.Portal.Chat.Web.Models;
+using Tango.Portal.Chat.Web.Services;
using Kusto.Data.Data;
using Microsoft.AspNetCore.Mvc;
-namespace ChatADX.Web.Controllers
+namespace Tango.Portal.Chat.Web.Controllers
{
[ApiController]
[Route("api/[controller]")]
@@ -31,9 +31,10 @@ namespace ChatADX.Web.Controllers
try
{
var schemaJson = _schema.GetSchemaJson();
+ var plannerPrompt = _schema.GetPlannerPrompt();
// 1) Ask the model for KQL
- var plan = await _llm.ProposeKqlAsync(req.Question, schemaJson, req.History, ct);
+ var plan = await _llm.ProposeKqlAsync(plannerPrompt, req.Question, schemaJson, req.History, ct);
if (plan.Assistant == "data")
{
@@ -81,7 +82,7 @@ namespace ChatADX.Web.Controllers
ThreadId = run.ThreadId // <-- echo back the thread id used/created
};
}
- else
+ else if (plan.Assistant == "docs")
{
// AFTER
var run = await _llm.AnswerWithAssistantAsync(
@@ -98,6 +99,14 @@ namespace ChatADX.Web.Controllers
ThreadId = run.ThreadId
};
}
+ else
+ {
+ return new ChatResponse
+ {
+ Answer = plan.ConversationAnswer,
+ ThreadId = req.ThreadId
+ };
+ }
}
catch (Exception ex)
{