From f04f81fcc0877e0d65cfab837350fe3b4d66a978 Mon Sep 17 00:00:00 2001 From: renearaos Date: Thu, 18 Jun 2026 21:15:49 -0400 Subject: [PATCH] fix: reset pending_reasoning after emit --- litellm/llms/minimax/chat/transformation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/litellm/llms/minimax/chat/transformation.py b/litellm/llms/minimax/chat/transformation.py index 0a20495d63a..f4161effbe7 100644 --- a/litellm/llms/minimax/chat/transformation.py +++ b/litellm/llms/minimax/chat/transformation.py @@ -3,7 +3,7 @@ MiniMax OpenAI transformation config - extends OpenAI chat config for MiniMax's """ import re -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, List, Optional, Tuple import litellm from litellm.llms.openai.chat.gpt_transformation import ( @@ -150,6 +150,7 @@ class MinimaxChatResponseIterator(OpenAIChatCompletionStreamingHandler): if self.pending_reasoning: delta["reasoning_content"] = self.pending_reasoning self.started_reasoning_content = True + self.pending_reasoning = "" elif "" in content and "" not in content: clean_content = content.replace("", "", 1) delta["content"] = None @@ -163,8 +164,6 @@ class MinimaxChatResponseIterator(OpenAIChatCompletionStreamingHandler): delta["reasoning_content"] = before delta["content"] = after if after.strip() else ("" if not after else None) self.finished_reasoning_content = True - elif has_reasoning: - pass elif not self.finished_reasoning_content and content.strip(): if not self.started_reasoning_content: self.started_reasoning_content = True