From f1278b3384270a53a4a668dbdb86891aaec16743 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Wed, 17 Jan 2024 12:28:15 -0600 Subject: [PATCH] Stop completion when exception has occurred. --- .../Conversations/Services/ConversationService.CallFunctions.cs | 1 + .../BotSharp.Core/Instructs/InstructService.CallFunctions.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.CallFunctions.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.CallFunctions.cs index ce614c2d..6b1ab6ca 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.CallFunctions.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.CallFunctions.cs @@ -43,6 +43,7 @@ public partial class ConversationService catch (Exception ex) { msg.Content = ex.Message; + msg.StopCompletion = true; _logger.LogError(msg.Content); } diff --git a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.CallFunctions.cs b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.CallFunctions.cs index ae36b518..0e558204 100644 --- a/src/Infrastructure/BotSharp.Core/Instructs/InstructService.CallFunctions.cs +++ b/src/Infrastructure/BotSharp.Core/Instructs/InstructService.CallFunctions.cs @@ -37,6 +37,7 @@ public partial class InstructService catch (Exception ex) { msg.Content = ex.Message; + msg.StopCompletion = true; _logger.LogError(msg.Content); }