Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Alibaba, Inc. and its affiliates.
package com.alibaba.dashscope.aigc.videosynthesis;

import static com.alibaba.dashscope.utils.ApiKeywords.*;

import com.alibaba.dashscope.base.HalfDuplexServiceParam;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
Expand All @@ -11,17 +9,20 @@
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.PreprocessInputImage;
import com.google.gson.JsonObject;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Singular;
import lombok.experimental.SuperBuilder;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.alibaba.dashscope.utils.ApiKeywords.*;

@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
Expand Down Expand Up @@ -93,6 +94,9 @@ public class VideoSynthesisParam extends HalfDuplexServiceParam {

@Builder.Default private String shotType = null;

/** The enable_overlays parameter. */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Javadoc for enableOverlays is a bit terse as it only repeats the parameter name. It would be more helpful for code clarity and maintainability to describe what this parameter actually does, for example, by explaining that it controls whether overlays are enabled on the generated video.

Suggested change
/** The enable_overlays parameter. */
/** Specifies whether to add overlays to the synthesized video. */

@Builder.Default private Boolean enableOverlays = null;

/** The inputs of the model. */
@Override
public JsonObject getInput() {
Expand Down Expand Up @@ -186,6 +190,10 @@ public Map<String, Object> getParameters() {
if (shotType != null) {
params.put(SHOT_TYPE, shotType);
}
if (enableOverlays != null) {
params.put(ENABLE_OVERLAYS, enableOverlays);
}

params.putAll(super.getParameters());
return params;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/alibaba/dashscope/utils/ApiKeywords.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,6 @@ public class ApiKeywords {
public static final String REFERENCE_VIDEO_DESCRIPTION = "reference_video_description";

public static final String SHOT_TYPE = "shot_type";

public static final String ENABLE_OVERLAYS = "enable_overlays";
}