From 4d99bf788c71a64670a5e4d73c01c0280267f755 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Mon, 25 Mar 2024 08:29:49 -0500 Subject: [PATCH] Fix StreamingLogHook.OnBreakpointUpdated --- .../BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs index 6d342e98..809c4cee 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs +++ b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs @@ -195,14 +195,19 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook, IR log += ", states are reset"; } var routing = _services.GetRequiredService(); - var agentId = routing.Context.ConversationId; + var agentId = routing.Context.GetCurrentAgentId(); var agent = await _agentService.LoadAgent(agentId); var input = new ContentLogInputModel() { Name = agent.Name, + AgentId = agentId, ConversationId = conversationId, Source = ContentLogSource.FunctionCall, + Message = new RoleDialogModel(AgentRole.Assistant, "OnBreakpointUpdated") + { + MessageId = _routingCtx.MessageId + }, Log = log }; await _chatHub.Clients.User(_user.Id).SendAsync("OnConversationContentLogGenerated", BuildContentLog(input));