Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix: rewrite enable thinking mode for minimax (#15496)

ちーe4ef9834dac5
diff --git a/internal/entity/models/minimax.go b/internal/entity/models/minimax.go
index 21c5f37142..97b825cf6a 100644
--- a/internal/entity/models/minimax.go
+++ b/internal/entity/models/minimax.go
@@ -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)