Skip to content

Commit 230f72e

Browse files
committed
fix(model): invalid incremental output
1 parent 6e01d0d commit 230f72e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/main/java/com/alibaba/dashscope/aigc/generation/GenerationParam.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static class ResultFormat {
9494
* apple
9595
* </pre>
9696
*/
97-
@Builder.Default private Boolean incrementalOutput = false;
97+
@Builder.Default private Boolean incrementalOutput;
9898

9999
/** Maximum tokens to generate. */
100100
private Integer maxTokens;
@@ -192,11 +192,14 @@ public Map<String, Object> getParameters() {
192192
params.put("temperature", temperature);
193193
}
194194
// Apply different logic based on model version
195-
if (ParamUtils.isQwenVersionThreeOrHigher(getModel())) {
195+
if (ParamUtils.isQwenVersionThreeOrHigher(getModel())) {
196196
if (incrementalOutput != null) {
197197
params.put("incremental_output", incrementalOutput);
198198
}
199199
} else {
200+
if (incrementalOutput == null) {
201+
incrementalOutput = false;
202+
}
200203
if (incrementalOutput) {
201204
params.put("incremental_output", incrementalOutput);
202205
}

src/main/java/com/alibaba/dashscope/aigc/multimodalconversation/MultiModalConversationParam.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public class MultiModalConversationParam extends HalfDuplexServiceParam {
9898
* apple
9999
* </pre>
100100
*/
101-
@Builder.Default private Boolean incrementalOutput = false;
101+
@Builder.Default private Boolean incrementalOutput;
102102

103103
/** Output format of the model including "text" and "audio". Default value: ["text"] */
104104
private List<String> modalities;
@@ -232,6 +232,9 @@ public Map<String, Object> getParameters() {
232232
params.put(ApiKeywords.INCREMENTAL_OUTPUT, incrementalOutput);
233233
}
234234
} else {
235+
if (incrementalOutput == null) {
236+
incrementalOutput = false;
237+
}
235238
if (incrementalOutput) {
236239
params.put(ApiKeywords.INCREMENTAL_OUTPUT, incrementalOutput);
237240
}

0 commit comments

Comments
 (0)