fix: key conflicts and event names

This commit is contained in:
Shivam Mishra
2025-12-15 20:05:14 +05:30
parent fbc0ff7509
commit 6fc0c5d777
4 changed files with 13 additions and 18 deletions
@@ -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
+1 -1
View File
@@ -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
+6 -11
View File
@@ -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)))