feat: add feature key for preference lookup
This commit is contained in:
@@ -25,6 +25,14 @@ class Captain::BaseTaskService
|
||||
raise NotImplementedError, "#{self.class} must implement #event_name"
|
||||
end
|
||||
|
||||
def feature_key
|
||||
raise NotImplementedError, "#{self.class} must implement #feature_key"
|
||||
end
|
||||
|
||||
def configured_model
|
||||
account.public_send("captain_#{feature_key}_model")
|
||||
end
|
||||
|
||||
def conversation
|
||||
@conversation ||= account.conversations.find_by(display_id: conversation_display_id)
|
||||
end
|
||||
|
||||
@@ -95,4 +95,8 @@ class Captain::FollowUpService < Captain::BaseTaskService
|
||||
def event_name
|
||||
'follow_up'
|
||||
end
|
||||
|
||||
def feature_key
|
||||
'editor'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,6 +87,10 @@ class Captain::LabelSuggestionService < Captain::BaseTaskService
|
||||
'label_suggestion'
|
||||
end
|
||||
|
||||
def feature_key
|
||||
'label_suggestion'
|
||||
end
|
||||
|
||||
def build_follow_up_context?
|
||||
false
|
||||
end
|
||||
|
||||
@@ -15,4 +15,8 @@ class Captain::ReplySuggestionService < Captain::BaseTaskService
|
||||
def event_name
|
||||
'reply_suggestion'
|
||||
end
|
||||
|
||||
def feature_key
|
||||
'editor'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -56,4 +56,8 @@ class Captain::RewriteService < Captain::BaseTaskService
|
||||
def event_name
|
||||
operation
|
||||
end
|
||||
|
||||
def feature_key
|
||||
'editor'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,4 +16,8 @@ class Captain::SummaryService < Captain::BaseTaskService
|
||||
def event_name
|
||||
'summarize'
|
||||
end
|
||||
|
||||
def feature_key
|
||||
'editor'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user