From 7553fce47a3307e448f9ed8203b975e9b4ad60f0 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Fri, 26 Sep 2025 14:39:36 -0500 Subject: [PATCH] Add Template name to InstructResult --- .../BotSharp.Abstraction/Instructs/Models/InstructResult.cs | 4 +++- .../Instructs/Services/InstructService.Execute.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Instructs/Models/InstructResult.cs b/src/Infrastructure/BotSharp.Abstraction/Instructs/Models/InstructResult.cs index a5b79a93..fe236863 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Instructs/Models/InstructResult.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Instructs/Models/InstructResult.cs @@ -4,7 +4,9 @@ public class InstructResult : ITrackableMessage { [JsonPropertyName("message_id")] public string MessageId { get; set; } - public string Text { get; set; } + public string Text { get; set; } = string.Empty; public object? Data { get; set; } + [JsonPropertyName("template")] + public string? Template{ get; set; } public Dictionary? States { get; set; } = new(); } diff --git a/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs b/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs index 9ebbd807..773392f1 100644 --- a/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs +++ b/src/Infrastructure/BotSharp.Core/Instructs/Services/InstructService.Execute.cs @@ -61,7 +61,8 @@ public partial class InstructService var response = new InstructResult { - MessageId = message.MessageId + MessageId = message.MessageId, + Template = templateName, }; if (completer is ITextCompletion textCompleter)