From 7415895db18ee84f4570d00ae4f10128e21d5083 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Thu, 7 Nov 2024 13:53:06 -0600 Subject: [PATCH] add flag --- .../BotSharp.Core/Conversations/Services/ConversationService.cs | 2 +- .../BotSharp.Core/Evaluations/EvaluatingService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs index 6c856591..f6326a7b 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs @@ -159,7 +159,7 @@ public partial class ConversationService : IConversationService public void SetConversationId(string conversationId, List states, bool isReadOnly = false) { _conversationId = conversationId; - _state.Load(_conversationId); + _state.Load(_conversationId, isReadOnly); states.ForEach(x => _state.SetState(x.Key, x.Value, activeRounds: x.ActiveRounds, source: StateSource.External)); } diff --git a/src/Infrastructure/BotSharp.Core/Evaluations/EvaluatingService.cs b/src/Infrastructure/BotSharp.Core/Evaluations/EvaluatingService.cs index 58da8688..ec5b3158 100644 --- a/src/Infrastructure/BotSharp.Core/Evaluations/EvaluatingService.cs +++ b/src/Infrastructure/BotSharp.Core/Evaluations/EvaluatingService.cs @@ -89,9 +89,9 @@ public class EvaluatingService : IEvaluatingService private async Task SendMessage(string agentId, string conversationId, string text) { var conv = _services.GetRequiredService(); + var routing = _services.GetRequiredService(); var inputMsg = new RoleDialogModel(AgentRole.User, text); - var routing = _services.GetRequiredService(); routing.Context.SetMessageId(conversationId, inputMsg.MessageId); conv.SetConversationId(conversationId, new List {