feat(provider) Add patched MiMo reasoning content support (#3298)

* Add patched MiMo reasoning content support

* Clarify MiMo patched model coverage

* Remove unused MiMo payload index

* Address MiMo review nits
This commit is contained in:
AochenShen99
2026-05-28 18:24:32 +08:00
committed by GitHub
parent 2fdfff0db3
commit 44677c5eb4
5 changed files with 419 additions and 0 deletions
+35
View File
@@ -995,6 +995,41 @@ def test_openai_responses_api_settings_are_passed_to_chatopenai(monkeypatch):
assert captured.get("output_version") == "responses/v1"
# ---------------------------------------------------------------------------
# Provider class path resolution
# ---------------------------------------------------------------------------
@pytest.mark.parametrize("model_id", ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-flash"])
def test_create_chat_model_resolves_patched_mimo_provider(model_id):
from deerflow.models.patched_mimo import PatchedChatMiMo
model = ModelConfig(
name=f"{model_id}-thinking",
display_name=f"{model_id} Thinking",
description=None,
use="deerflow.models.patched_mimo:PatchedChatMiMo",
model=model_id,
api_key="test-key",
base_url="https://api.xiaomimimo.com/v1",
supports_thinking=True,
when_thinking_enabled={"extra_body": {"thinking": {"type": "enabled"}}},
supports_vision=False,
)
cfg = _make_app_config([model])
chat_model = factory_module.create_chat_model(
name=f"{model_id}-thinking",
thinking_enabled=True,
app_config=cfg,
attach_tracing=False,
)
assert isinstance(chat_model, PatchedChatMiMo)
assert chat_model.model_name == model_id
assert chat_model.extra_body["thinking"]["type"] == "enabled"
# ---------------------------------------------------------------------------
# Duplicate keyword argument collision (issue #1977)
# ---------------------------------------------------------------------------