Skip to content

Commit e5b288c

Browse files
lahumanRe-bin
authored andcommitted
fix: map MiniMax reasoning_effort to reasoning_split
1 parent 558aa98 commit e5b288c

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

nanobot/providers/openai_compat_provider.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ def _build_kwargs(
398398
extra: dict[str, Any] | None = None
399399
if spec.name == "dashscope":
400400
extra = {"enable_thinking": thinking_enabled}
401+
elif spec.name == "minimax":
402+
extra = {"reasoning_split": thinking_enabled}
401403
elif spec.name in (
402404
"volcengine", "volcengine_coding_plan",
403405
"byteplus", "byteplus_coding_plan",

tests/providers/test_litellm_kwargs.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,21 @@ def test_dashscope_no_extra_body_when_reasoning_effort_none() -> None:
740740
assert "extra_body" not in kw
741741

742742

743+
def test_minimax_reasoning_split_enabled_with_reasoning_effort() -> None:
744+
kw = _build_kwargs_for("minimax", "MiniMax-M2.7", reasoning_effort="medium")
745+
assert kw["extra_body"] == {"reasoning_split": True}
746+
747+
748+
def test_minimax_reasoning_split_disabled_for_minimal() -> None:
749+
kw = _build_kwargs_for("minimax", "MiniMax-M2.7", reasoning_effort="minimal")
750+
assert kw["extra_body"] == {"reasoning_split": False}
751+
752+
753+
def test_minimax_no_extra_body_when_reasoning_effort_none() -> None:
754+
kw = _build_kwargs_for("minimax", "MiniMax-M2.7", reasoning_effort=None)
755+
assert "extra_body" not in kw
756+
757+
743758
def test_volcengine_thinking_enabled() -> None:
744759
kw = _build_kwargs_for("volcengine", "doubao-seed-2-0-pro", reasoning_effort="high")
745760
assert kw["extra_body"] == {"thinking": {"type": "enabled"}}

0 commit comments

Comments
 (0)