1
1
package org .springframework .ai .qwen ;
2
2
3
3
import com .alibaba .dashscope .common .ResponseFormat ;
4
- import org .springframework .ai .model .function .FunctionCallback ;
5
4
import org .springframework .ai .model .tool .ToolCallingChatOptions ;
6
5
import org .springframework .ai .tool .ToolCallback ;
7
6
import org .springframework .lang .Nullable ;
@@ -101,7 +100,7 @@ public class QwenChatOptions implements ToolCallingChatOptions {
101
100
* Collection of {@link ToolCallback}s to be used for tool calling in the chat
102
101
* completion requests.
103
102
*/
104
- private List <FunctionCallback > toolCallbacks ;
103
+ private List <ToolCallback > toolCallbacks ;
105
104
106
105
/**
107
106
* Collection of tool names to be resolved at runtime and used for tool calling in the
@@ -155,7 +154,7 @@ public class QwenChatOptions implements ToolCallingChatOptions {
155
154
* not specified, it will be judged based on the model name when called, but these
156
155
* judgments may not keep up with the latest situation.
157
156
*/
158
- private Boolean multimodalModel ;
157
+ private Boolean isMultimodalModel ;
159
158
160
159
/**
161
160
* Whether the model supports incremental output in the streaming output mode. This
@@ -190,7 +189,7 @@ private QwenChatOptions(Builder builder) {
190
189
this .searchOptions = builder .searchOptions ;
191
190
this .translationOptions = builder .translationOptions ;
192
191
this .vlHighResolutionImages = builder .vlHighResolutionImages ;
193
- this .multimodalModel = builder .multimodalModel ;
192
+ this .isMultimodalModel = builder .multimodalModel ;
194
193
this .custom = builder .custom ;
195
194
}
196
195
@@ -269,29 +268,17 @@ public Double getTopP() {
269
268
}
270
269
271
270
@ Override
272
- public List <FunctionCallback > getToolCallbacks () {
271
+ public List <ToolCallback > getToolCallbacks () {
273
272
return this .toolCallbacks ;
274
273
}
275
274
276
275
@ Override
277
- public void setToolCallbacks (List <FunctionCallback > toolCallbacks ) {
276
+ public void setToolCallbacks (List <ToolCallback > toolCallbacks ) {
278
277
Assert .notNull (toolCallbacks , "toolCallbacks cannot be null" );
279
278
Assert .noNullElements (toolCallbacks , "toolCallbacks cannot contain null elements" );
280
279
this .toolCallbacks = toolCallbacks ;
281
280
}
282
281
283
- @ Override
284
- @ Deprecated
285
- public List <FunctionCallback > getFunctionCallbacks () {
286
- return this .getToolCallbacks ();
287
- }
288
-
289
- @ Override
290
- @ Deprecated
291
- public void setFunctionCallbacks (List <FunctionCallback > functionCallbacks ) {
292
- this .setToolCallbacks (functionCallbacks );
293
- }
294
-
295
282
@ Override
296
283
public Set <String > getToolNames () {
297
284
return this .toolNames ;
@@ -305,21 +292,9 @@ public void setToolNames(Set<String> toolNames) {
305
292
this .toolNames = toolNames ;
306
293
}
307
294
308
- @ Override
309
- @ Deprecated
310
- public Set <String > getFunctions () {
311
- return this .getToolNames ();
312
- }
313
-
314
- @ Override
315
- @ Deprecated
316
- public void setFunctions (Set <String > functionNames ) {
317
- this .setToolNames (functionNames );
318
- }
319
-
320
295
@ Override
321
296
@ Nullable
322
- public Boolean isInternalToolExecutionEnabled () {
297
+ public Boolean getInternalToolExecutionEnabled () {
323
298
return internalToolExecutionEnabled ;
324
299
}
325
300
@@ -391,12 +366,12 @@ public void setVlHighResolutionImages(Boolean vlHighResolutionImages) {
391
366
this .vlHighResolutionImages = vlHighResolutionImages ;
392
367
}
393
368
394
- public Boolean isMultimodalModel () {
395
- return multimodalModel ;
369
+ public Boolean getIsMultimodalModel () {
370
+ return isMultimodalModel ;
396
371
}
397
372
398
- public void setMultimodalModel (Boolean multimodalModel ) {
399
- this .multimodalModel = multimodalModel ;
373
+ public void setIsMultimodalModel (Boolean isMultimodalModel ) {
374
+ this .isMultimodalModel = isMultimodalModel ;
400
375
}
401
376
402
377
public Boolean getSupportIncrementalOutput () {
@@ -454,7 +429,7 @@ public static class Builder {
454
429
455
430
private Integer topK ;
456
431
457
- private List <FunctionCallback > toolCallbacks = new ArrayList <>();
432
+ private List <ToolCallback > toolCallbacks = new ArrayList <>();
458
433
459
434
private Set <String > toolNames = new HashSet <>();
460
435
@@ -528,7 +503,7 @@ public Builder topK(Integer topK) {
528
503
return this ;
529
504
}
530
505
531
- public Builder toolCallbacks (List <FunctionCallback > toolCallbacks ) {
506
+ public Builder toolCallbacks (List <ToolCallback > toolCallbacks ) {
532
507
this .toolCallbacks = toolCallbacks ;
533
508
return this ;
534
509
}
@@ -614,7 +589,7 @@ public Builder overrideWith(QwenChatOptions fromOptions) {
614
589
this .translationOptions (getOrDefault (fromOptions .getTranslationOptions (), this .translationOptions ));
615
590
this .vlHighResolutionImages (
616
591
getOrDefault (fromOptions .getVlHighResolutionImages (), this .vlHighResolutionImages ));
617
- this .isMultimodalModel (getOrDefault (fromOptions .isMultimodalModel (), this .multimodalModel ));
592
+ this .isMultimodalModel (getOrDefault (fromOptions .getIsMultimodalModel (), this .multimodalModel ));
618
593
this .supportIncrementalOutput (
619
594
getOrDefault (fromOptions .getSupportIncrementalOutput (), this .supportIncrementalOutput ));
620
595
this .custom (copyIfNotNull (getOrDefault (fromOptions .getCustom (), this .custom )));
0 commit comments