Skip to content

Commit 3944f0e

Browse files
lengjiayikevinlin09
authored andcommitted
[Update] support multimodal dialog pass through parameters
1 parent f7f3329 commit 3944f0e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/alibaba/dashscope/multimodal/MultiModalRequestParam.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public static class UpStream {
6060
private String mode;
6161
// private int sampleRate;
6262
@Builder.Default private String audioFormat = CONST_AUDIO_FORMAT_PCM; //support pcm/opus
63+
private Map<String, Object> passThroughParams;
6364
}
6465

6566
@Builder
@@ -73,6 +74,7 @@ public static class DownStream {
7374
@Builder.Default private int pitchRate = 100; //50~200
7475
@Builder.Default private int speechRate = 100; //50~200
7576
@Builder.Default private String audioFormat = "pcm"; //support pcm/mp3
77+
private Map<String, Object> passThroughParams;
7678
}
7779

7880
@Builder
@@ -114,6 +116,7 @@ public static class BizParams {
114116
private Object userQueryParams;
115117
private Object userPromptParams;
116118
private Object videos;
119+
private Map<String, Object> passThroughParams;
117120
}
118121

119122
public void clearParameters() {
@@ -141,6 +144,9 @@ public Map<String, Object> getParameters() {
141144
upStreamParams.put(CONST_NAME_UP_STREAM_TYPE, upStream.type);
142145
upStreamParams.put(CONST_NAME_UP_STREAM_MODE, upStream.mode);
143146
upStreamParams.put(CONST_NAME_UP_STREAM_AUDIO_FORMAT, upStream.audioFormat);
147+
if (upStream.passThroughParams != null) {
148+
upStreamParams.putAll(upStream.passThroughParams);
149+
}
144150
params.put(CONST_NAME_UP_STREAM, upStreamParams);
145151
}
146152

@@ -155,6 +161,9 @@ public Map<String, Object> getParameters() {
155161
downStreamParams.put(CONST_NAME_DOWN_STREAM_VOLUME, downStream.volume);
156162
downStreamParams.put(CONST_NAME_DOWN_STREAM_PITCH_RATE, downStream.pitchRate);
157163
downStreamParams.put(CONST_NAME_DOWN_STREAM_SPEECH_RATE, downStream.speechRate);
164+
if (downStream.passThroughParams != null) {
165+
downStreamParams.putAll(downStream.passThroughParams);
166+
}
158167
params.put(CONST_NAME_DOWN_STREAM, downStreamParams);
159168
}
160169

@@ -193,6 +202,9 @@ public Map<String, Object> getParameters() {
193202
bizParamsParams.put(CONST_NAME_BIZ_PARAMS_USER_QUERY_PARAMS, bizParams.userQueryParams);
194203
bizParamsParams.put(CONST_NAME_BIZ_PARAMS_USER_PROMPT_PARAMS, bizParams.userPromptParams);
195204
bizParamsParams.put(CONST_NAME_BIZ_PARAMS_VIDEOS, bizParams.videos);
205+
if (bizParams.passThroughParams != null) {
206+
bizParamsParams.putAll(bizParams.passThroughParams);
207+
}
196208
params.put(CONST_NAME_BIZ_PARAMS, bizParamsParams);
197209
}
198210

0 commit comments

Comments
 (0)