From e4ef9834dac512e60374fca1bc5e50dfbe470f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A1=E3=83=BC?= <85853517+Dimon0000000@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:22:11 +0800 Subject: [PATCH] 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) --- internal/entity/models/minimax.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) 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)