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:
ちー
2026-06-02 13:22:11 +08:00
committed by GitHub
parent 600590cd18
commit e4ef9834da

View File

@@ -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)