Skip to content

Commit 1440ed5

Browse files
authored
feat(model/cosyvoice): add custom input by parameters (#193)
1 parent 9dc44b5 commit 1440ed5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/java/com/alibaba/dashscope/audio/ttsv2/enrollment/VoiceEnrollmentParam.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ public JsonObject getInput() {
5555
if (maxPromptAudioLength > 0) {
5656
input.addProperty("max_prompt_audio_length", maxPromptAudioLength);
5757
}
58+
// add parameters into input
59+
if (parameters != null) {
60+
for (String key : parameters.keySet()) {
61+
Object value = parameters.get(key);
62+
if (key != null && value != null) {
63+
input.add(key, JsonUtils.toJsonElement(value));
64+
}
65+
}
66+
}
5867
break;
5968
case LIST:
6069
input.addProperty(ApiKeywords.ACTION, operationType.getValue());

0 commit comments

Comments
 (0)