diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenChatClient.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenChatClient.java index 85fa771bd1..63f3af7760 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenChatClient.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenChatClient.java @@ -106,7 +106,7 @@ public class QianWenChatClient implements ChatClient, StreamingChatClient { .messages(messageList) .maxTokens(chatOptions.getMaxTokens()) .resultFormat(QwenParam.ResultFormat.MESSAGE) - .topP(Double.valueOf(chatOptions.getTopP())) + .topP(chatOptions.getTopP() == null ? null : Double.valueOf(chatOptions.getTopP())) .topK(chatOptions.getTopK()) .temperature(chatOptions.getTemperature()) // 控制流式输出模式,即后面的内容会包含已经输出的内容;设置为True,将开启增量输出模式,后面的输出不会包含已经输出的内容,您需要自行拼接整体输出 diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenOptions.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenOptions.java index 4f7632c974..07805cf11c 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenOptions.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenOptions.java @@ -43,25 +43,14 @@ public class QianWenOptions implements ChatOptions { return null; } -// @Override -// public void setTemperature(Float temperature) { -// -// } -// -// @Override -// public void setTopP(Float topP) { -// this.topP = topP; -// } - @Override public Integer getTopK() { return null; } -// @Override -// public void setTopK(Integer topK) { -// -// } + public Float getTopP() { + return topP; + } @Data @Accessors