From 9bad721754fe8bbe2e5f459d0706e0fefac569f3 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 20 九月 2026 09:05:41 +0800
Subject: [PATCH] feat(mes): 添加智能质检报告功能与AI导入能力

---
 yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java b/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java
index fd2c3d9..d004349 100644
--- a/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java
+++ b/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java
@@ -15,6 +15,7 @@
 import org.springframework.ai.openai.OpenAiChatModel;
 import org.springframework.ai.vectorstore.VectorStore;
 import org.springframework.ai.vectorstore.milvus.MilvusVectorStore;
+import java.time.Duration;
 import java.util.Map;
 
 /**
@@ -26,11 +27,15 @@
 public class AiModelFactoryImpl implements AiModelFactory {
 
     @Override
-    public ChatModel getOrCreateChatModel(AiPlatformEnum platform, String apiKey, String url, String model) {
-        String cacheKey = buildCacheKey(ChatModel.class, platform, apiKey, url, model);
+    public ChatModel getOrCreateChatModel(AiPlatformEnum platform, String apiKey, String url, String model,
+                                          Double temperature, Integer maxTokens, Duration timeout) {
+        // 娓╁害 / maxTokens / 瓒呮椂蹇呴』涓�璧疯繘 cacheKey锛氬惁鍒欏湪搴撻噷鏀逛簡杩欎簺鍙傛暟鍚庯紝
+        // 缂撳瓨浠嶇劧杩斿洖绗竴娆℃瀯寤虹殑妯″瀷锛屾敼浜嗙瓑浜庢病鏀癸紙涓斿畬鍏ㄩ潤榛橈級
+        String cacheKey = buildCacheKey(ChatModel.class, platform, apiKey, url, model,
+                temperature, maxTokens, timeout);
         return Singleton.get(cacheKey, (Func0<ChatModel>) () -> {
             if (platform == AiPlatformEnum.TONG_YI) {
-                return AiAutoConfiguration.buildTongYiChatModel(apiKey, model);
+                return AiAutoConfiguration.buildTongYiChatModel(apiKey, model, temperature, maxTokens, timeout);
             }
             throw new IllegalArgumentException(StrUtil.format("涓嶆敮鎸佺殑骞冲彴({})", platform));
         });

--
Gitblit v1.9.3