Merge branch 'feature/cw-6123' of github.com:chatwoot/chatwoot into feature/cw-6123
This commit is contained in:
@@ -497,7 +497,7 @@ const menuItems = computed(() => {
|
||||
{
|
||||
name: 'Settings Captain',
|
||||
label: t('SIDEBAR.CAPTAIN_AI'),
|
||||
icon: 'i-lucide-sparkles',
|
||||
icon: 'i-woot-captain',
|
||||
to: accountScopedRoute('captain_settings_index'),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -10,11 +10,10 @@ class Integrations::LlmBaseService
|
||||
CACHEABLE_EVENTS = %w[].freeze
|
||||
|
||||
# Maps event names to feature keys in config/llm.yml
|
||||
EDITOR_EVENTS = %w[rephrase fix_spelling_grammar shorten expand make_friendly make_formal simplify].freeze
|
||||
ASSISTANT_EVENTS = %w[summarize reply_suggestion].freeze
|
||||
EDITOR_EVENTS = %w[rephrase fix_spelling_grammar shorten expand make_friendly make_formal simplify summarize reply_suggestion].freeze
|
||||
LABEL_SUGGESTION_EVENTS = %w[label_suggestion].freeze
|
||||
|
||||
ALLOWED_EVENT_NAMES = (EDITOR_EVENTS + ASSISTANT_EVENTS).freeze
|
||||
ALLOWED_EVENT_NAMES = EDITOR_EVENTS.freeze
|
||||
|
||||
pattr_initialize [:hook!, :event!]
|
||||
|
||||
@@ -41,7 +40,6 @@ class Integrations::LlmBaseService
|
||||
|
||||
def feature_name_for_event
|
||||
return 'editor' if EDITOR_EVENTS.include?(event_name)
|
||||
return 'assistant' if ASSISTANT_EVENTS.include?(event_name)
|
||||
return 'label_suggestion' if LABEL_SUGGESTION_EVENTS.include?(event_name)
|
||||
|
||||
nil
|
||||
|
||||
@@ -236,13 +236,13 @@ RSpec.describe Account do
|
||||
|
||||
describe 'with saved model preferences' do
|
||||
it 'returns saved preferences merged with defaults' do
|
||||
account.update!(captain_models: { 'editor' => 'gpt-4.1-mini', 'assistant' => 'gpt-5.1' })
|
||||
account.update!(captain_models: { 'editor' => 'gpt-4.1-mini', 'assistant' => 'gpt-5.2' })
|
||||
|
||||
prefs = account.captain_preferences
|
||||
|
||||
expect(prefs[:models]['editor']).to eq('gpt-4.1-mini')
|
||||
expect(prefs[:models]['assistant']).to eq('gpt-5.1')
|
||||
expect(prefs[:models]['copilot']).to eq(Llm::Models.default_model_for('copilot'))
|
||||
expect(prefs[:models]['assistant']).to eq('gpt-5.2')
|
||||
expect(prefs[:models]['copilot']).to eq(Llm::ConfigService.default_model_for_feature('copilot'))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user