mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-30 00:12:40 +03:00
fix(llm): gate MiniMax reasoning_split by model capability (#826)
MinimaxChatOpenAI unconditionally set reasoning_split=True, but the kwarg is only valid on M2.x reasoning models. The openai SDK's strict kwarg validation raised TypeError for Coding Plan and any other non- reasoning MiniMax model. Adds requires_reasoning_split to ModelCapabilities, gates the payload injection on it, and only sets True for _MINIMAX_THINKING (M2.x exact IDs and the ^MiniMax-M\d forward-compat pattern). Same shape as the existing supports_tool_choice gate. Regression tests cover both halves: M2.x models still receive the flag, non-reasoning MiniMax models do not.
This commit is contained in:
@@ -118,6 +118,11 @@ class MinimaxChatOpenAI(NormalizedChatOpenAI):
|
||||
``reasoning_split=True`` in the request body redirects the thinking
|
||||
block into ``reasoning_details`` so ``content`` stays clean.
|
||||
|
||||
The flag is gated by ``ModelCapabilities.requires_reasoning_split``
|
||||
because non-reasoning MiniMax endpoints (Coding Plan, MiniMax-Text-01)
|
||||
reject the parameter via the openai SDK's strict kwarg validation
|
||||
(#826).
|
||||
|
||||
Tool-choice handling for M2.x — those models accept only the string
|
||||
enum ``{"none", "auto"}`` and reject langchain's function-spec dict —
|
||||
is handled by the capability dispatch in
|
||||
@@ -126,7 +131,8 @@ class MinimaxChatOpenAI(NormalizedChatOpenAI):
|
||||
|
||||
def _get_request_payload(self, input_, *, stop=None, **kwargs):
|
||||
payload = super()._get_request_payload(input_, stop=stop, **kwargs)
|
||||
payload.setdefault("reasoning_split", True)
|
||||
if get_capabilities(self.model_name).requires_reasoning_split:
|
||||
payload.setdefault("reasoning_split", True)
|
||||
return payload
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user