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 @@