Skip to content

Commit 1122f04

Browse files
committed
fix(dashscope): Missing additional headers and params for DashScopeHttpClient
1 parent 40fb4cd commit 1122f04

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

agentscope-core/src/main/java/io/agentscope/core/model/DashScopeChatModel.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,23 @@ private Flux<ChatResponse> streamWithHttpClient(
230230

231231
if (stream) {
232232
// Streaming mode
233-
return httpClient.stream(request)
233+
return httpClient.stream(
234+
request,
235+
effectiveOptions.getAdditionalHeaders(),
236+
effectiveOptions.getAdditionalBodyParams(),
237+
effectiveOptions.getAdditionalQueryParams())
234238
.map(response -> formatter.parseResponse(response, start));
235239
} else {
236240
// Non-streaming mode
237241
return Flux.defer(
238242
() -> {
239243
try {
240-
DashScopeResponse response = httpClient.call(request);
244+
DashScopeResponse response =
245+
httpClient.call(
246+
request,
247+
effectiveOptions.getAdditionalHeaders(),
248+
effectiveOptions.getAdditionalBodyParams(),
249+
effectiveOptions.getAdditionalQueryParams());
241250
ChatResponse chatResponse = formatter.parseResponse(response, start);
242251
return Flux.just(chatResponse);
243252
} catch (Exception e) {

0 commit comments

Comments
 (0)