From 7a201aa8640940e9d440ee1f9143840013f52ade Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Tue, 12 Nov 2024 16:45:21 -0600 Subject: [PATCH] minor change --- .../Evaluations/Services/EvaluatingService.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Evaluations/Services/EvaluatingService.cs b/src/Infrastructure/BotSharp.Core/Evaluations/Services/EvaluatingService.cs index ec563ca4..95bcf040 100644 --- a/src/Infrastructure/BotSharp.Core/Evaluations/Services/EvaluatingService.cs +++ b/src/Infrastructure/BotSharp.Core/Evaluations/Services/EvaluatingService.cs @@ -61,7 +61,10 @@ public partial class EvaluatingService : IEvaluatingService dialogs.Add(new RoleDialogModel(AgentRole.User, question)); prompt += question.Trim(); - response = await SendMessage(request.AgentId, conv.Id, question); + response = await SendMessage(request.AgentId, conv.Id, question, states: new List + { + new MessageState("channel", ConversationChannel.OpenAPI) + }); dialogs.Add(new RoleDialogModel(AgentRole.Assistant, response.Content)); prompt += $"\r\n{AgentRole.Assistant}: {response.Content.Trim()}"; prompt += $"\r\n{AgentRole.User}: "; @@ -86,17 +89,16 @@ public partial class EvaluatingService : IEvaluatingService return conv; } - private async Task SendMessage(string agentId, string conversationId, string text) + private async Task SendMessage(string agentId, string conversationId, string text, + PostbackMessageModel? postback = null, + List? states = null) { var conv = _services.GetRequiredService(); var routing = _services.GetRequiredService(); var inputMsg = new RoleDialogModel(AgentRole.User, text); routing.Context.SetMessageId(conversationId, inputMsg.MessageId); - conv.SetConversationId(conversationId, new List - { - new MessageState("channel", ConversationChannel.OpenAPI) - }); + conv.SetConversationId(conversationId, states ?? []); RoleDialogModel response = default;