|
@@ -300,7 +300,14 @@ class AgentService:
|
|
|
if configs.get().get('debug_flags', {}).get('disable_llm_api_call', False):
|
|
|
return 'LLM模拟回复 {}'.format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
|
|
if chat_service_type == ChatServiceType.OPENAI_COMPATIBLE:
|
|
|
- if chat_config.get('use_multimodal_model', False):
|
|
|
+ # 指定了LLM模型则优先使用指定模型
|
|
|
+ if chat_config.get('model_name', None):
|
|
|
+ llm_client = chat_service.OpenAICompatible.create_client(chat_config['model_name'])
|
|
|
+ chat_completion = llm_client.chat.completions.create(
|
|
|
+ messages=chat_config['messages'],
|
|
|
+ model=chat_config['model_name'],
|
|
|
+ )
|
|
|
+ elif chat_config.get('use_multimodal_model', False):
|
|
|
chat_completion = self.multimodal_model_client.chat.completions.create(
|
|
|
messages=chat_config['messages'],
|
|
|
model=self.multimodal_model_name,
|