@@ -69,6 +69,7 @@ public class DashScopeChatModel extends ChatModelBase {
6969 private final String modelName ;
7070 private final boolean stream ;
7171 private final Boolean enableThinking ; // nullable
72+ private final Boolean enableSearch ; // nullable
7273 private final GenerateOptions defaultOptions ;
7374 private final String protocol ; // HTTP or WEBSOCKET
7475 private final String baseUrl ; // Optional custom base URL
@@ -105,6 +106,7 @@ private boolean requiresMultiModalConversationAPI() {
105106 * @param modelName the model name (e.g., "qwen-max", "qwen-vl-plus")
106107 * @param stream whether streaming should be enabled (ignored if enableThinking is true)
107108 * @param enableThinking whether thinking mode should be enabled (null for disabled)
109+ * @param enableSearch whether search enhancement should be enabled (null for disabled)
108110 * @param defaultOptions default generation options (null for defaults)
109111 * @param protocol the protocol to use ("HTTP" or "WEBSOCKET", null for HTTP)
110112 * @param baseUrl custom base URL for DashScope API (null for default)
@@ -115,6 +117,7 @@ public DashScopeChatModel(
115117 String modelName ,
116118 boolean stream ,
117119 Boolean enableThinking ,
120+ Boolean enableSearch ,
118121 GenerateOptions defaultOptions ,
119122 String protocol ,
120123 String baseUrl ,
@@ -123,6 +126,7 @@ public DashScopeChatModel(
123126 this .modelName = modelName ;
124127 this .stream = enableThinking != null && enableThinking ? true : stream ;
125128 this .enableThinking = enableThinking ;
129+ this .enableSearch = enableSearch ;
126130 this .defaultOptions =
127131 defaultOptions != null ? defaultOptions : GenerateOptions .builder ().build ();
128132 this .protocol = protocol != null ? protocol : Protocol .HTTP .getValue ();
@@ -431,6 +435,11 @@ private void applyModelSpecificOptions(
431435 param .setIncrementalOutput (Boolean .TRUE );
432436 }
433437 }
438+
439+ // Model-specific settings for search mode
440+ if (Boolean .TRUE .equals (enableSearch )) {
441+ param .setEnableSearch (Boolean .TRUE );
442+ }
434443 }
435444
436445 /**
@@ -638,6 +647,7 @@ public static class Builder {
638647 private String modelName ;
639648 private boolean stream = true ;
640649 private Boolean enableThinking ;
650+ private Boolean enableSearch ;
641651 private GenerateOptions defaultOptions = null ;
642652 private String protocol = Protocol .HTTP .getValue ();
643653 private String baseUrl ;
@@ -699,6 +709,20 @@ public Builder enableThinking(Boolean enableThinking) {
699709 return this ;
700710 }
701711
712+ /**
713+ * Sets whether search enhancement should be enabled.
714+ *
715+ * <p>When enabled, the model can access internet search to provide more up-to-date
716+ * and accurate responses.
717+ *
718+ * @param enableSearch true to enable search mode, false to disable, null for default (disabled)
719+ * @return this builder instance
720+ */
721+ public Builder enableSearch (Boolean enableSearch ) {
722+ this .enableSearch = enableSearch ;
723+ return this ;
724+ }
725+
702726 /**
703727 * Sets the default generation options.
704728 *
@@ -765,6 +789,7 @@ public DashScopeChatModel build() {
765789 modelName ,
766790 stream ,
767791 enableThinking ,
792+ enableSearch ,
768793 effectiveOptions ,
769794 protocol ,
770795 baseUrl ,
0 commit comments