aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs')
-rw-r--r--Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs
new file mode 100644
index 000000000..d968d0738
--- /dev/null
+++ b/Software/Visual_Studio_22/Tango.Portal.Chat.Web/Models/Contracts.cs
@@ -0,0 +1,53 @@
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace ChatADX.Web.Models
+{
+ public sealed class ProposeKqlResult
+ {
+ [JsonPropertyName("kql")]
+ public string Kql { get; set; } = string.Empty;
+
+ [JsonPropertyName("parameterTypes")]
+ public Dictionary<string, string>? ParameterTypes { get; set; }
+
+ [JsonPropertyName("parameters")]
+ public Dictionary<string, string> Parameters { get; set; } = new();
+
+ // NEW: be flexible about shapes from the model
+ [JsonPropertyName("assumptions")]
+ [JsonConverter(typeof(FlexibleStringListConverter))]
+ public List<string>? Assumptions { get; set; }
+
+ [JsonPropertyName("why")]
+ public string? Why { get; set; }
+
+ [JsonPropertyName("assistant")]
+ public string Assistant { get; set; } = string.Empty;
+ }
+
+ public sealed class ChatMessage
+ {
+ // "user" | "assistant"
+ public string Role { get; set; } = "user";
+ public string Content { get; set; } = string.Empty;
+ }
+
+ public sealed class ChatRequest
+ {
+ public List<ChatMessage>? History { get; set; }
+
+ public string? ThreadId { get; set; } // shared Assistants thread for the whole chat
+ public string Question { get; set; } = string.Empty;
+ public string? From { get; set; }
+ public string? To { get; set; }
+ }
+
+ public sealed class ChatResponse
+ {
+ public string? ThreadId { get; set; } // shared Assistants thread for the whole chat
+ public string Answer { get; set; } = string.Empty;
+ public string UsedKql { get; set; } = string.Empty;
+ public object? Preview { get; set; }
+ }
+}