Commit 430dc99d124a695e00af55bbc9ec6fdee324a026
1 parent
c96d966a
【代码优化】AI:适配 Spring AI 1.0.6 对 ZhiPu 的兼容
Showing
2 changed files
with
9 additions
and
6 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/chat/ZhiPuAiChatModelTests.java
| ... | ... | @@ -22,9 +22,12 @@ import java.util.List; |
| 22 | 22 | */ |
| 23 | 23 | public class ZhiPuAiChatModelTests { |
| 24 | 24 | |
| 25 | - private final ZhiPuAiApi zhiPuAiApi = new ZhiPuAiApi("32f84543e54eee31f8d56b2bd6020573.3vh9idLJZ2ZhxDEs"); | |
| 26 | - private final ZhiPuAiChatModel chatModel = new ZhiPuAiChatModel(zhiPuAiApi, | |
| 27 | - ZhiPuAiChatOptions.builder().model(ZhiPuAiApi.ChatModel.GLM_4.getName()).build()); | |
| 25 | + private final ZhiPuAiChatModel chatModel = new ZhiPuAiChatModel( | |
| 26 | + new ZhiPuAiApi("32f84543e54eee31f8d56b2bd6020573.3vh9idLJZ2ZhxDEs"), // 密钥 | |
| 27 | + ZhiPuAiChatOptions.builder() | |
| 28 | + .model(ZhiPuAiApi.ChatModel.GLM_4.getName()) // 模型 | |
| 29 | + .build() | |
| 30 | + ); | |
| 28 | 31 | |
| 29 | 32 | @Test |
| 30 | 33 | @Disabled | ... | ... |
yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/image/ZhiPuAiImageModelTests.java
| ... | ... | @@ -13,9 +13,9 @@ import org.springframework.ai.zhipuai.api.ZhiPuAiImageApi; |
| 13 | 13 | */ |
| 14 | 14 | public class ZhiPuAiImageModelTests { |
| 15 | 15 | |
| 16 | - private final ZhiPuAiImageApi imageApi = new ZhiPuAiImageApi( | |
| 17 | - "78d3228c1d9e5e342a3e1ab349e2dd7b.VXLoq5vrwK2ofboy"); | |
| 18 | - private final ZhiPuAiImageModel imageModel = new ZhiPuAiImageModel(imageApi); | |
| 16 | + private final ZhiPuAiImageModel imageModel = new ZhiPuAiImageModel( | |
| 17 | + new ZhiPuAiImageApi("78d3228c1d9e5e342a3e1ab349e2dd7b.VXLoq5vrwK2ofboy") // 密钥 | |
| 18 | + ); | |
| 19 | 19 | |
| 20 | 20 | @Test |
| 21 | 21 | @Disabled | ... | ... |