fix: make qwen3-vl-plus usable as chat/vision model in Go mode (#17254)

This commit is contained in:
euvre
2026-07-23 11:14:08 +08:00
committed by GitHub
parent 1e445fbd68
commit b095a5511a
4 changed files with 33 additions and 5 deletions

View File

@@ -32,10 +32,14 @@
},
{
"name": "qwen3-vl-plus",
"max_tokens": 260096,
"max_tokens": 256000,
"model_types": [
"vision"
]
"vision",
"chat"
],
"tools": {
"support": true
}
},
{
"name": "qwen-tts-flash",

View File

@@ -551,4 +551,4 @@
}
}
]
}
}

View File

@@ -112,6 +112,11 @@ func (a *AliyunModel) ChatWithMessages(ctx context.Context, modelName string, me
}
}
// For qwen3 models on DashScope, enable_thinking defaults to true when
// omitted. RAGFlow's default is to disable thinking unless explicitly
// enabled by the user, matching Python's chat_model.py behavior.
applyQwen3ThinkingDefault(modelName, reqBody)
jsonData, err := json.Marshal(reqBody)
if err != nil {
return nil, fmt.Errorf("failed to marshal request: %w", err)
@@ -253,6 +258,11 @@ func (a *AliyunModel) ChatStreamlyWithSender(ctx context.Context, modelName stri
}
}
// For qwen3 models on DashScope, enable_thinking defaults to true when
// omitted. RAGFlow's default is to disable thinking unless explicitly
// enabled by the user, matching Python's chat_model.py behavior.
applyQwen3ThinkingDefault(modelName, reqBody)
jsonData, err := json.Marshal(reqBody)
if err != nil {
return fmt.Errorf("failed to marshal request: %w", err)
@@ -337,6 +347,21 @@ func (a *AliyunModel) ChatStreamlyWithSender(ctx context.Context, modelName stri
return sender(&endOfStream, nil)
}
// applyQwen3ThinkingDefault ensures enable_thinking=false is sent for qwen3
// models when it hasn't been explicitly configured. DashScope defaults
// enable_thinking to true for qwen3 models, which produces reasoning output
// that RAGFlow doesn't expect in most pipelines. Mirrors Python's
// chat_model.py default of enable_thinking=False for qwen3.
func applyQwen3ThinkingDefault(modelName string, reqBody map[string]interface{}) {
if !strings.Contains(strings.ToLower(modelName), "qwen3") {
return
}
if _, alreadySet := reqBody["enable_thinking"]; alreadySet {
return
}
reqBody["enable_thinking"] = false
}
// aliyunToolChoice prevents qwen-flash from repeatedly issuing another tool call
// after a tool result has already been supplied. With "auto", qwen-flash can
// keep emitting tool_calls even for a successful result until the ReAct graph

View File

@@ -538,7 +538,6 @@ export const useSetDocumentPipelineParser = () => {
parser_id: parserId,
pipeline_id: pipelineId,
};
if (parserConfig) {
updateData.parser_config = isPipelineParserConfig(parserConfig)