diff --git a/enterprise/app/services/captain/llm/assistant_action_classifier_service.rb b/enterprise/app/services/captain/llm/assistant_action_classifier_service.rb index be7d1b094..dcdeeeae2 100644 --- a/enterprise/app/services/captain/llm/assistant_action_classifier_service.rb +++ b/enterprise/app/services/captain/llm/assistant_action_classifier_service.rb @@ -2,14 +2,12 @@ class Captain::Llm::AssistantActionClassifierService < Llm::BaseAiService include Integrations::LlmInstrumentation PROMPT_VERSION = 'v1_custom_xml_precedence'.freeze - DEFAULT_MODEL = 'gpt-4.1'.freeze MAX_CONTEXT_MESSAGES = 10 def initialize(assistant:, conversation:) super() @assistant = assistant @conversation = conversation - @model = DEFAULT_MODEL @temperature = 0.0 end diff --git a/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb b/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb index f187fdb59..3a899c9b7 100644 --- a/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb +++ b/spec/enterprise/services/captain/llm/assistant_action_classifier_service_spec.rb @@ -67,6 +67,17 @@ RSpec.describe Captain::Llm::AssistantActionClassifierService do ) end + it 'uses the configured Captain model from the base LLM service' do + create(:installation_config, name: 'CAPTAIN_OPEN_AI_MODEL', value: 'provider/custom-model') + + expect(RubyLLM).to receive(:chat).with(model: 'provider/custom-model').and_return(mock_chat) + allow(mock_chat).to receive(:ask).and_return(mock_response) + + result = service.classify(message_history: message_history, assistant_response: 'Would you like to talk to support?') + + expect(result).to include('model' => 'provider/custom-model') + end + context 'when the assistant has no custom instructions' do before do assistant.update!(config: assistant.config.except('instructions'))