From 278751c107eb3fbaf70339bf869fa2bb4b0cdec1 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Thu, 13 Feb 2025 15:38:09 -0600 Subject: [PATCH] clean code --- .../Hooks/ChatHubConversationHook.cs | 33 ------------------- .../Hooks/StreamingLogHook.cs | 21 ------------ 2 files changed, 54 deletions(-) diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs index 165fe880..8e8d210c 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs +++ b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/ChatHubConversationHook.cs @@ -183,39 +183,6 @@ public class ChatHubConversationHook : ConversationHookBase return sidecar == null || !sidecar.IsEnabled(); } - private async Task InitClientConversation(ConversationViewModel conversation) - { - await _chatHub.Clients.User(_user.Id).SendAsync(INIT_CLIENT_CONVERSATION, conversation); - } - - private async Task ReceiveClientMessage(ChatResponseModel model) - { - await _chatHub.Clients.User(_user.Id).SendAsync(RECEIVE_CLIENT_MESSAGE, model); - } - - private async Task ReceiveAssistantMessage(string? json) - { - await _chatHub.Clients.User(_user.Id).SendAsync(RECEIVE_ASSISTANT_MESSAGE, json); - } - - private async Task GenerateSenderAction(ConversationSenderActionModel action) - { - await _chatHub.Clients.User(_user.Id).SendAsync(GENERATE_SENDER_ACTION, action); - } - - private async Task DeleteMessage(ChatResponseModel model) - { - await _chatHub.Clients.User(_user.Id).SendAsync(DELETE_MESSAGE, model); - } - - private async Task GenerateNotification(string? json) - { - await _chatHub.Clients.User(_user.Id).SendAsync(GENERATE_NOTIFICATION, json); - } - - - - private async Task InitClientConversation(string conversationId, ConversationViewModel conversation) { if (_settings.EventDispatchBy == EventDispatchType.Group) diff --git a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs index 15b57fce..5d28ee2e 100644 --- a/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs +++ b/src/Plugins/BotSharp.Plugin.ChatHub/Hooks/StreamingLogHook.cs @@ -437,27 +437,6 @@ public class StreamingLogHook : ConversationHookBase, IContentGeneratingHook, IR #region Private methods - //private async Task SendContentLog(ContentLogInputModel input) - //{ - // await _chatHub.Clients.User(_user.Id).SendAsync(CONTENT_LOG_GENERATED, BuildContentLog(input)); - //} - - //private async Task SendStateLog(string conversationId, string agentId, Dictionary states, RoleDialogModel message) - //{ - // await _chatHub.Clients.User(_user.Id).SendAsync(STATE_LOG_GENERATED, BuildStateLog(conversationId, agentId, states, message)); - //} - - //private async Task SendAgentQueueLog(string conversationId, string log) - //{ - // await _chatHub.Clients.User(_user.Id).SendAsync(AGENT_QUEUE_CHANGED, BuildAgentQueueChangedLog(conversationId, log)); - //} - - //private async Task SendStateChange(StateChangeModel stateChange) - //{ - // await _chatHub.Clients.User(_user.Id).SendAsync(STATE_CHANGED, BuildStateChangeLog(stateChange)); - //} - - private async Task SendContentLog(string conversationId, ContentLogInputModel input) { if (_settings.EventDispatchBy == EventDispatchType.Group)