Skip to content

Commit 6553761

Browse files
mose-zmmose-x.zm
andauthored
Fix/add miss wan27 params (#196)
* add miss params audio_setting * add miss params audio_setting * Add empty conditions --------- Co-authored-by: mose-x.zm <zm02074348@alibaba-inc.com>
1 parent a04ac72 commit 6553761

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/main/java/com/alibaba/dashscope/aigc/videosynthesis/VideoSynthesis.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ public static class MediaType {
7171
public static final String DRIVING_AUDIO = "driving_audio";
7272
}
7373

74+
public static class AudioSetting {
75+
public static final String AUTO = "auto";
76+
public static final String ORIGIN = "origin";
77+
public static final String NO_AUDIO = "no_audio";
78+
}
79+
7480
/**
7581
* Create ApiServiceOption
7682
*

src/main/java/com/alibaba/dashscope/aigc/videosynthesis/VideoSynthesisParam.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public static class Media {
119119

120120
@Builder.Default private String ratio = null;
121121

122+
@Builder.Default private String audioSetting = null;
123+
122124
/** The inputs of the model. */
123125
@Override
124126
public JsonObject getInput() {
@@ -196,11 +198,11 @@ public Map<String, Object> getParameters() {
196198
params.put(DURATION, duration);
197199
}
198200

199-
if (size != null) {
201+
if (size != null && !size.isEmpty()) {
200202
params.put(SIZE, size);
201203
}
202204

203-
if (resolution != null) {
205+
if (resolution != null && !resolution.isEmpty()) {
204206
params.put(RESOLUTION, resolution);
205207
}
206208

@@ -221,15 +223,18 @@ public Map<String, Object> getParameters() {
221223
if (audio != null) {
222224
params.put(AUDIO, audio);
223225
}
224-
if (shotType != null) {
226+
if (shotType != null && !shotType.isEmpty()) {
225227
params.put(SHOT_TYPE, shotType);
226228
}
227229
if (enableOverlays != null) {
228230
params.put(ENABLE_OVERLAYS, enableOverlays);
229231
}
230-
if (ratio != null) {
232+
if (ratio != null && !ratio.isEmpty()) {
231233
params.put(RATIO, ratio);
232234
}
235+
if (audioSetting != null && !audioSetting.isEmpty()) {
236+
params.put(AUDIO_SETTING, audioSetting);
237+
}
233238

234239
params.putAll(super.getParameters());
235240
return params;

src/main/java/com/alibaba/dashscope/utils/ApiKeywords.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ public class ApiKeywords {
202202

203203
public static final String RATIO = "ratio";
204204

205+
public static final String AUDIO_SETTING = "audio_setting";
206+
205207
public static final String REFERENCE_VIDEO_DESCRIPTION = "reference_video_description";
206208

207209
public static final String SHOT_TYPE = "shot_type";

0 commit comments

Comments
 (0)