feat: add feature key for preference lookup

This commit is contained in:
Shivam Mishra
2026-01-13 19:31:36 +05:30
parent ab1cb7af86
commit eee6ccc6f5
7 changed files with 55 additions and 0 deletions
+8
View File
@@ -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
+4
View File
@@ -95,4 +95,8 @@ class Captain::FollowUpService < Captain::BaseTaskService
def event_name
'follow_up'
end
def feature_key
'editor'
end
end
+4
View File
@@ -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
+4
View File
@@ -15,4 +15,8 @@ class Captain::ReplySuggestionService < Captain::BaseTaskService
def event_name
'reply_suggestion'
end
def feature_key
'editor'
end
end
+4
View File
@@ -56,4 +56,8 @@ class Captain::RewriteService < Captain::BaseTaskService
def event_name
operation
end
def feature_key
'editor'
end
end
+4
View File
@@ -16,4 +16,8 @@ class Captain::SummaryService < Captain::BaseTaskService
def event_name
'summarize'
end
def feature_key
'editor'
end
end