From ddf617fc307f948b8ef82654b2f6f38254b7d5fe Mon Sep 17 00:00:00 2001 From: Haiping Date: Tue, 12 Dec 2023 09:06:39 -0600 Subject: [PATCH] Send message always in assistant role --- .../Services/ConversationService.SendMessage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs index 19ccad1b..ad1faeef 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.SendMessage.cs @@ -99,9 +99,9 @@ public partial class ConversationService var agent = await agentService.GetAgent(response.CurrentAgentId); var agentName = agent.Name; - var text = response.Role == AgentRole.Function ? - $"Sending [{agentName}] {response.FunctionName}: {response.Content}" : - $"Sending [{agentName}] {response.Role}: {response.Content}"; + // Send message always in assistant role + response.Role = AgentRole.Assistant; + var text = $"Sending [{agentName}] {response.Role}: {response.Content}"; #if DEBUG Console.WriteLine(text, Color.Yellow); #else