diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiAutoConfiguration.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiAutoConfiguration.java index fa61eeb3f..b9be65407 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiAutoConfiguration.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiAutoConfiguration.java @@ -30,13 +30,19 @@ public class YudaoAiAutoConfiguration { @ConditionalOnProperty(value = "yudao.ai.xinghuo.enable", havingValue = "true") public XingHuoChatClient xingHuoChatClient(YudaoAiProperties yudaoAiProperties) { YudaoAiProperties.XingHuoProperties xingHuoProperties = yudaoAiProperties.getXinghuo(); + // 转换配置 + XingHuoOptions xingHuoOptions = new XingHuoOptions(); + xingHuoOptions.setChatModel(xingHuoProperties.getChatModel()); + xingHuoOptions.setTopK(xingHuoProperties.getTopK()); + xingHuoOptions.setTemperature(xingHuoProperties.getTemperature()); + xingHuoOptions.setMaxTokens(xingHuoProperties.getMaxTokens()); return new XingHuoChatClient( new XingHuoApi( xingHuoProperties.getAppId(), xingHuoProperties.getAppKey(), xingHuoProperties.getSecretKey() ), - new XingHuoOptions().setChatModel(xingHuoProperties.getChatModel()) + xingHuoOptions ); } @@ -44,6 +50,7 @@ public class YudaoAiAutoConfiguration { @ConditionalOnProperty(value = "yudao.ai.qianwen.enable", havingValue = "true") public QianWenChatClient qianWenChatClient(YudaoAiProperties yudaoAiProperties) { YudaoAiProperties.QianWenProperties qianWenProperties = yudaoAiProperties.getQianwen(); + // 转换配置 QianWenOptions qianWenOptions = new QianWenOptions(); qianWenOptions.setTopK(qianWenProperties.getTopK()); qianWenOptions.setTopP(qianWenProperties.getTopP()); @@ -62,6 +69,12 @@ public class YudaoAiAutoConfiguration { @ConditionalOnProperty(value = "yudao.ai.yiyan.enable", havingValue = "true") public YiYanChatClient yiYanChatClient(YudaoAiProperties yudaoAiProperties) { YudaoAiProperties.YiYanProperties yiYanProperties = yudaoAiProperties.getYiyan(); + // 转换配置 + YiYanOptions yiYanOptions = new YiYanOptions(); + yiYanOptions.setTopK(yiYanProperties.getTopK()); + yiYanOptions.setTopP(yiYanProperties.getTopP()); + yiYanOptions.setTemperature(yiYanProperties.getTemperature()); + yiYanOptions.setMaxOutputTokens(yiYanProperties.getMaxTokens()); return new YiYanChatClient( new YiYanApi( yiYanProperties.getAppKey(), @@ -69,6 +82,7 @@ public class YudaoAiAutoConfiguration { yiYanProperties.getChatModel(), yiYanProperties.getRefreshTokenSecondTime() ), - new YiYanOptions().setMax_output_tokens(2048)); + yiYanOptions + ); } } \ No newline at end of file