diff --git a/app/javascript/dashboard/components/widgets/WootWriter/CopilotMenuBar.vue b/app/javascript/dashboard/components/widgets/WootWriter/CopilotMenuBar.vue index 552569c58..2e2d3910d 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/CopilotMenuBar.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/CopilotMenuBar.vue @@ -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', }, ], }, diff --git a/enterprise/lib/enterprise/integrations/openai_processor_service.rb b/enterprise/lib/enterprise/integrations/openai_processor_service.rb index b09c7ca7c..57639e8cb 100644 --- a/enterprise/lib/enterprise/integrations/openai_processor_service.rb +++ b/enterprise/lib/enterprise/integrations/openai_processor_service.rb @@ -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 diff --git a/lib/integrations/llm_base_service.rb b/lib/integrations/llm_base_service.rb index 4652ad76f..accca98b4 100644 --- a/lib/integrations/llm_base_service.rb +++ b/lib/integrations/llm_base_service.rb @@ -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 diff --git a/lib/integrations/openai/processor_service.rb b/lib/integrations/openai/processor_service.rb index 0f648cf22..90a094733 100644 --- a/lib/integrations/openai/processor_service.rb +++ b/lib/integrations/openai/processor_service.rb @@ -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)))