refactor: rename suggest_label to label_suggestion
This commit is contained in:
@@ -28,7 +28,7 @@ class OpenAIAPI extends ApiClient {
|
||||
this.conversation_events = [
|
||||
'summarize',
|
||||
'reply_suggestion',
|
||||
'suggest_label',
|
||||
'label_suggestion',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
<template>
|
||||
<div v-if="isAIIntegrationEnabled" class="position-relative">
|
||||
<div v-if="!message">
|
||||
<woot-button
|
||||
v-if="isPrivateNote"
|
||||
v-tooltip.top-end="$t('INTEGRATION_SETTINGS.OPEN_AI.SUMMARY_TITLE')"
|
||||
icon="book-pulse"
|
||||
color-scheme="secondary"
|
||||
variant="smooth"
|
||||
size="small"
|
||||
:is-loading="uiFlags.summarize"
|
||||
@click="processEvent('summarize')"
|
||||
/>
|
||||
<woot-button
|
||||
v-if="isPrivateNote"
|
||||
v-tooltip.top-end="$t('INTEGRATION_SETTINGS.OPEN_AI.SUMMARY_TITLE')"
|
||||
|
||||
@@ -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