Commit e4bb7262c3acaf493c5489adc210694eb83910dc

Authored by cherishsince
1 parent eef9ed1b

【优化】星火兼容 ChatOptions 配置

yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/chatxinghuo/XingHuoOptions.java
@@ -6,7 +6,7 @@ import lombok.experimental.Accessors; @@ -6,7 +6,7 @@ import lombok.experimental.Accessors;
6 6
7 /** 7 /**
8 * 讯飞星火 8 * 讯飞星火
9 - * 9 + * <p>
10 * author: fansili 10 * author: fansili
11 * time: 2024/3/16 20:29 11 * time: 2024/3/16 20:29
12 */ 12 */
@@ -16,7 +16,7 @@ public class XingHuoOptions implements ChatOptions { @@ -16,7 +16,7 @@ public class XingHuoOptions implements ChatOptions {
16 16
17 /** 17 /**
18 * https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E 18 * https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
19 - * 19 + * <p>
20 * 指定访问的领域: 20 * 指定访问的领域:
21 * general指向V1.5版本; 21 * general指向V1.5版本;
22 * generalv2指向V2版本; 22 * generalv2指向V2版本;
@@ -33,25 +33,25 @@ public class XingHuoOptions implements ChatOptions { @@ -33,25 +33,25 @@ public class XingHuoOptions implements ChatOptions {
33 * V1.5取值为[1,4096] 33 * V1.5取值为[1,4096]
34 * V2.0、V3.0和V3.5取值为[1,8192],默认为2048。 34 * V2.0、V3.0和V3.5取值为[1,8192],默认为2048。
35 */ 35 */
36 - private Integer max_tokens; 36 + private Integer maxTokens;
37 /** 37 /**
38 * 取值为[1,6],默认为4 38 * 取值为[1,6],默认为4
39 */ 39 */
40 - private Integer top_k; 40 + private Integer topK;
41 /** 41 /**
42 - * 需要保障用户下的唯一性,用于关联用户会话 42 + * 需要保障用户下的唯一性,用于关联用户会话
43 */ 43 */
44 - private String chat_id; 44 + private String chatId;
45 45
46 46
47 @Override 47 @Override
48 public Float getTemperature() { 48 public Float getTemperature() {
49 - return null; 49 + return this.temperature;
50 } 50 }
51 51
52 @Override 52 @Override
53 public void setTemperature(Float temperature) { 53 public void setTemperature(Float temperature) {
54 - 54 + this.temperature = temperature;
55 } 55 }
56 56
57 @Override 57 @Override
@@ -66,11 +66,11 @@ public class XingHuoOptions implements ChatOptions { @@ -66,11 +66,11 @@ public class XingHuoOptions implements ChatOptions {
66 66
67 @Override 67 @Override
68 public Integer getTopK() { 68 public Integer getTopK() {
69 - return null; 69 + return this.topK;
70 } 70 }
71 71
72 @Override 72 @Override
73 public void setTopK(Integer topK) { 73 public void setTopK(Integer topK) {
74 - 74 + this.topK = topK;
75 } 75 }
76 } 76 }