From 4a053a8d291da9019bda20415576c9035eea6e98 Mon Sep 17 00:00:00 2001 From: Pranav Date: Thu, 22 May 2025 17:24:45 -0700 Subject: [PATCH] remove copilot channel --- app/channels/copilot_channel.rb | 35 --------- .../components/copilot/CopilotContainer.vue | 74 +++++++------------ .../helpers/CopilotActionCableConnector.js | 49 ------------ 3 files changed, 26 insertions(+), 132 deletions(-) delete mode 100644 app/channels/copilot_channel.rb delete mode 100644 app/javascript/dashboard/helpers/CopilotActionCableConnector.js diff --git a/app/channels/copilot_channel.rb b/app/channels/copilot_channel.rb deleted file mode 100644 index 2fde1c32f..000000000 --- a/app/channels/copilot_channel.rb +++ /dev/null @@ -1,35 +0,0 @@ -class CopilotChannel < ApplicationCable::Channel - def subscribed - current_user - current_account - ensure_stream - end - - def message(data) - return if @current_account.blank? - - Captain::ProcessCopilotMessageJob.perform_later( - assistant_id: data['assistant_id'], - message: data['message'], - options: { - user_id: @current_user.id, - conversation_id: data['conversation_id'], - previous_history: data['previous_history'] - } - ) - end - - def ensure_stream - stream_from "copilot_#{@current_account.id}_#{@current_user.id}" - end - - def current_user - @current_user ||= User.find(params[:user_id]) - end - - def current_account - return if current_user.blank? - - @current_account ||= @current_user.accounts.find(params[:account_id]) - end -end diff --git a/app/javascript/dashboard/components/copilot/CopilotContainer.vue b/app/javascript/dashboard/components/copilot/CopilotContainer.vue index 42a281aea..43bf8d44b 100644 --- a/app/javascript/dashboard/components/copilot/CopilotContainer.vue +++ b/app/javascript/dashboard/components/copilot/CopilotContainer.vue @@ -1,11 +1,10 @@