feat: ensure captain limits
This commit is contained in:
@@ -7,6 +7,7 @@ module Enterprise::Api::V1::Accounts::ConversationsController
|
||||
def copilot
|
||||
assistant = @conversation.inbox.captain_assistant
|
||||
return render json: { message: I18n.t('captain.copilot_error') } unless assistant
|
||||
return render json: { message: I18n.t('captain.copilot_limit') } unless @conversation.inbox.captain_active?
|
||||
|
||||
response = Captain::Copilot::ChatService.new(
|
||||
assistant,
|
||||
|
||||
@@ -10,6 +10,6 @@ module Enterprise::MessageTemplates::HookExecutionService
|
||||
end
|
||||
|
||||
def should_process_captain_response?
|
||||
conversation.pending? && message.incoming? && inbox.captain_assistant.present?
|
||||
conversation.pending? && message.incoming? && inbox.captain_active?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user