File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,16 @@ func (cm *ChatModel) parseCustomOpetions(opts ...model.Option) []model.Option {
226
226
// Using extra fields to pass the custom options to the underlying client
227
227
extraFields := make (map [string ]any )
228
228
if qwenOpts .EnableThinking != nil {
229
+ // If using BaiLian, use `chat_template_kwargs`.
230
+ // See https://bailian.console.aliyun.com/?tab=api#/api/?type=model&url=2712576
229
231
enableThinkingSwitch := map [string ]bool {
230
232
"enable_thinking" : * qwenOpts .EnableThinking ,
231
233
}
232
234
extraFields ["chat_template_kwargs" ] = enableThinkingSwitch
235
+
236
+ // If using vLLM, use `enable_thinking` directly.
237
+ // See https://qwen.readthedocs.io/zh-cn/latest/deployment/vllm.html
238
+ extraFields ["enable_thinking" ] = * qwenOpts .EnableThinking
233
239
}
234
240
if len (extraFields ) > 0 {
235
241
opts = append (opts , openai .WithExtraFields (extraFields ))
You can’t perform that action at this time.
0 commit comments