fix: key conflicts and event names
This commit is contained in:
@@ -60,31 +60,31 @@ const menuItems = computed(() => {
|
||||
label: t(
|
||||
'INTEGRATION_SETTINGS.OPEN_AI.REPLY_OPTIONS.CHANGE_TONE.OPTIONS.PROFESSIONAL'
|
||||
),
|
||||
key: 'make_professional',
|
||||
key: 'professional',
|
||||
},
|
||||
{
|
||||
label: t(
|
||||
'INTEGRATION_SETTINGS.OPEN_AI.REPLY_OPTIONS.CHANGE_TONE.OPTIONS.CASUAL'
|
||||
),
|
||||
key: 'make_casual',
|
||||
key: 'casual',
|
||||
},
|
||||
{
|
||||
label: t(
|
||||
'INTEGRATION_SETTINGS.OPEN_AI.REPLY_OPTIONS.CHANGE_TONE.OPTIONS.STRAIGHTFORWARD'
|
||||
),
|
||||
key: 'make_straightforward',
|
||||
key: 'straightforward',
|
||||
},
|
||||
{
|
||||
label: t(
|
||||
'INTEGRATION_SETTINGS.OPEN_AI.REPLY_OPTIONS.CHANGE_TONE.OPTIONS.CONFIDENT'
|
||||
),
|
||||
key: 'make_confident',
|
||||
key: 'confident',
|
||||
},
|
||||
{
|
||||
label: t(
|
||||
'INTEGRATION_SETTINGS.OPEN_AI.REPLY_OPTIONS.CHANGE_TONE.OPTIONS.FRIENDLY'
|
||||
),
|
||||
key: 'make_friendly',
|
||||
key: 'friendly',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Enterprise::Integrations::OpenaiProcessorService
|
||||
ALLOWED_EVENT_NAMES = %w[summarize reply_suggestion label_suggestion fix_spelling_grammar
|
||||
make_friendly make_formal casual professional confident straightforward].freeze
|
||||
friendly casual professional confident straightforward].freeze
|
||||
CACHEABLE_EVENTS = %w[label_suggestion].freeze
|
||||
|
||||
def label_suggestion_message
|
||||
|
||||
@@ -7,7 +7,7 @@ class Integrations::LlmBaseService
|
||||
# 120000 * 4 = 480,000 characters (rounding off downwards to 400,000 to be safe)
|
||||
TOKEN_LIMIT = 400_000
|
||||
GPT_MODEL = Llm::Config::DEFAULT_MODEL
|
||||
ALLOWED_EVENT_NAMES = %w[summarize reply_suggestion fix_spelling_grammar casual professional make_friendly make_formal confident
|
||||
ALLOWED_EVENT_NAMES = %w[summarize reply_suggestion fix_spelling_grammar casual professional friendly confident
|
||||
straightforward].freeze
|
||||
CACHEABLE_EVENTS = %w[].freeze
|
||||
|
||||
|
||||
@@ -8,16 +8,16 @@ class Integrations::Openai::ProcessorService < Integrations::LlmBaseService
|
||||
make_api_call(summarize_body)
|
||||
end
|
||||
|
||||
def confident_message
|
||||
tone_instruction = determine_tone_instruction('confident')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
end
|
||||
|
||||
def fix_spelling_grammar_message
|
||||
make_api_call(build_api_call_body('Please fix the spelling and grammar of the following response. ' \
|
||||
"#{LANGUAGE_INSTRUCTION}"))
|
||||
end
|
||||
|
||||
def confident_message
|
||||
tone_instruction = determine_tone_instruction('confident')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
end
|
||||
|
||||
def straightforward_message
|
||||
tone_instruction = determine_tone_instruction('straightforward')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
@@ -28,16 +28,11 @@ class Integrations::Openai::ProcessorService < Integrations::LlmBaseService
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
end
|
||||
|
||||
def make_friendly_message
|
||||
def friendly_message
|
||||
tone_instruction = determine_tone_instruction('friendly')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
end
|
||||
|
||||
def make_formal_message
|
||||
tone_instruction = determine_tone_instruction('formal')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
end
|
||||
|
||||
def professional_message
|
||||
tone_instruction = determine_tone_instruction('professional')
|
||||
make_api_call(build_api_call_body(tone_rewrite_prompt(tone_instruction)))
|
||||
|
||||
Reference in New Issue
Block a user