refactor: rename suggest_label to label_suggestion
This commit is contained in:
@@ -11,11 +11,11 @@ class Integrations::Openai::ProcessorService < Integrations::OpenaiProcessorServ
|
||||
make_api_call(rephrase_body)
|
||||
end
|
||||
|
||||
def suggest_label_message
|
||||
payload = suggest_label_body
|
||||
def label_suggestion_message
|
||||
payload = label_suggestion_body
|
||||
return nil if payload.blank?
|
||||
|
||||
make_api_call(suggest_label_body)
|
||||
make_api_call(label_suggestion_body)
|
||||
end
|
||||
|
||||
private
|
||||
@@ -119,7 +119,7 @@ class Integrations::Openai::ProcessorService < Integrations::OpenaiProcessorServ
|
||||
}.to_json
|
||||
end
|
||||
|
||||
def suggest_label_body
|
||||
def label_suggestion_body
|
||||
content = labels_with_messages
|
||||
return nil if content.blank?
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ class Integrations::OpenaiProcessorService
|
||||
API_URL = 'https://api.openai.com/v1/chat/completions'.freeze
|
||||
GPT_MODEL = 'gpt-3.5-turbo'.freeze
|
||||
|
||||
ALLOWED_EVENT_NAMES = %w[rephrase summarize reply_suggestion suggest_label].freeze
|
||||
CACHEABLE_EVENTS = %w[suggest_label].freeze
|
||||
ALLOWED_EVENT_NAMES = %w[rephrase summarize reply_suggestion label_suggestion].freeze
|
||||
CACHEABLE_EVENTS = %w[label_suggestion].freeze
|
||||
|
||||
pattr_initialize [:hook!, :event!]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user