mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
fix: rewrite enable thinking mode for minimax (#15496)
### What problem does this PR solve? fix the bad thinking mode for minimax ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -115,8 +115,17 @@ func (z *MinimaxModel) ChatWithMessages(modelName string, messages []Message, ap
|
||||
reqBody["do_sample"] = *chatModelConfig.DoSample
|
||||
}
|
||||
|
||||
if chatModelConfig.Thinking != nil {
|
||||
reqBody["thinking"] = *chatModelConfig.Thinking
|
||||
if chatModelConfig != nil && chatModelConfig.Thinking != nil {
|
||||
if *chatModelConfig.Thinking {
|
||||
reqBody["thinking"] = map[string]interface{}{
|
||||
"type": "adaptive",
|
||||
}
|
||||
reqBody["reasoning_split"] = true
|
||||
} else {
|
||||
reqBody["thinking"] = map[string]interface{}{
|
||||
"type": "disabled",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,8 +257,17 @@ func (z *MinimaxModel) ChatStreamlyWithSender(modelName string, messages []Messa
|
||||
reqBody["stop"] = *modelConfig.Stop
|
||||
}
|
||||
|
||||
if modelConfig.Thinking != nil {
|
||||
reqBody["thinking"] = *modelConfig.Thinking
|
||||
if modelConfig != nil && modelConfig.Thinking != nil {
|
||||
if *modelConfig.Thinking {
|
||||
reqBody["thinking"] = map[string]interface{}{
|
||||
"type": "adaptive",
|
||||
}
|
||||
reqBody["reasoning_split"] = true
|
||||
} else {
|
||||
reqBody["thinking"] = map[string]interface{}{
|
||||
"type": "disabled",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsonData, err := json.Marshal(reqBody)
|
||||
|
||||
Reference in New Issue
Block a user