Files
leadchat/enterprise/app/services/captain/tools/base_service.rb
Pranav a07f2a7c1b feat: Add support for search_conversations in copilot (#11520)
Earlier, we were manually checking if a user was an agent and filtering
their conversations based on inboxes. This logic should have been part
of the conversation permissions service.

This PR moves the check to the right place and updates the logic
accordingly.

Other updates:
- Add support for search_conversations service for copilot.
- Use PermissionFilterService in contacts/conversations, conversations,
copilot search_conversations.

---------

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2025-05-20 19:22:17 -07:00

40 lines
747 B
Ruby

class Captain::Tools::BaseService
attr_accessor :assistant
def initialize(assistant, user: nil)
@assistant = assistant
@user = user
end
def name
raise NotImplementedError, "#{self.class} must implement name"
end
def description
raise NotImplementedError, "#{self.class} must implement description"
end
def parameters
raise NotImplementedError, "#{self.class} must implement parameters"
end
def execute(arguments)
raise NotImplementedError, "#{self.class} must implement execute"
end
def to_registry_format
{
type: 'function',
function: {
name: name,
description: description,
parameters: parameters
}
}
end
def active?
true
end
end