diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/chatqianwen/QianWenOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/chatqianwen/QianWenOptions.java index eb598d366..bc7564df5 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/chatqianwen/QianWenOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/chatqianwen/QianWenOptions.java @@ -18,11 +18,6 @@ import java.util.List; @Accessors public class QianWenOptions implements ChatOptions { - private String appId; - /** - * 是否流式输出, 默认为否。 - */ - private Boolean stream; /** * 用户与模型的对话历史 */ 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 483e88477..2eadf156b 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 @@ -44,13 +44,16 @@ 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()); + qianWenOptions.setTemperature(qianWenProperties.getTemperature()); return new QianWenChatClient( new QianWenApi( - qianWenProperties.getAgentKey(), + qianWenProperties.getApiKey(), QianWenChatModal.QWEN_72B_CHAT ), - new QianWenOptions() - .setAppId(qianWenProperties.getAppId()) + qianWenOptions ); } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiProperties.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiProperties.java index 40f310f4e..4ccfb2a4c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiProperties.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiProperties.java @@ -42,26 +42,15 @@ public class YudaoAiProperties { @Data @Accessors(chain = true) public static class QianWenProperties extends ChatProperties { + /** - * 阿里云:服务器接入点 + * api key */ - private String endpoint = "bailian.cn-beijing.aliyuncs.com"; + private String apiKey; /** - * 阿里云:权限 accessKeyId + * model */ - private String accessKeyId; - /** - * 阿里云:权限 accessKeySecret - */ - private String accessKeySecret; - /** - * 阿里云:agentKey - */ - private String agentKey; - /** - * 阿里云:agentKey(相当于应用id) - */ - private String appId; + private YiYanChatModel model; } @@ -93,5 +82,7 @@ public class YudaoAiProperties { * token 刷新时间(默认 86400 = 24小时) */ private int refreshTokenSecondTime = 86400; + + private YiYanChatModel model; } }