Commit 3fdb8fd5c3e4e8dcbbcd8c5da3038e6d556dc9f4
1 parent
89db7883
【解决todo】通义千问增加 model 和 temperature
Showing
2 changed files
with
10 additions
and
2 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/config/YudaoAiAutoConfiguration.java
| ... | ... | @@ -63,6 +63,8 @@ public class YudaoAiAutoConfiguration { |
| 63 | 63 | YudaoAiProperties.QianWenProperties qianWenProperties = yudaoAiProperties.getQianwen(); |
| 64 | 64 | // 转换配置 |
| 65 | 65 | QianWenOptions qianWenOptions = new QianWenOptions(); |
| 66 | + qianWenOptions.setModel(qianWenProperties.getModel().getModel()); | |
| 67 | + qianWenOptions.setTemperature(qianWenProperties.getTemperature()); | |
| 66 | 68 | // qianWenOptions.setTopK(qianWenProperties.getTopK()); TODO 芋艿:后续弄 |
| 67 | 69 | qianWenOptions.setTopP(qianWenProperties.getTopP()); |
| 68 | 70 | qianWenOptions.setMaxTokens(qianWenProperties.getMaxTokens()); | ... | ... |
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/tongyi/QianWenOptions.java
| ... | ... | @@ -6,8 +6,6 @@ import lombok.experimental.Accessors; |
| 6 | 6 | |
| 7 | 7 | import java.util.List; |
| 8 | 8 | |
| 9 | -// TODO @fan:增加一个 model 参数 | |
| 10 | -// TODO @fan:增加一个 Temperature 参数 | |
| 11 | 9 | /** |
| 12 | 10 | * 阿里云 千问 属性 |
| 13 | 11 | * |
| ... | ... | @@ -34,6 +32,14 @@ public class QianWenOptions implements ChatOptions { |
| 34 | 32 | * 用于限制模型生成token的数量,max_tokens设置的是生成上限,并不表示一定会生成这么多的token数量。其中qwen1.5-14b-chat、qwen1.5-7b-chat、qwen-14b-chat和qwen-7b-chat最大值和默认值均为1500,qwen-1.8b-chat、qwen-1.8b-longcontext-chat和qwen-72b-chat最大值和默认值均为2000 |
| 35 | 33 | */ |
| 36 | 34 | private Integer maxTokens = 1500; |
| 35 | + /** | |
| 36 | + * 模型 | |
| 37 | + */ | |
| 38 | + private String model; | |
| 39 | + /** | |
| 40 | + * temperature | |
| 41 | + */ | |
| 42 | + private Float temperature; | |
| 37 | 43 | |
| 38 | 44 | // |
| 39 | 45 | // 适配 ChatOptions | ... | ... |