fix(vlm): send MiMo thinking parameter as object format#2477
Open
LllYuu0392 wants to merge 1 commit into
Open
Conversation
Xiaomi MiMo API requires the thinking parameter as an object
({"type": "enabled"|"disabled"}) rather than a boolean.
Without this fix, _apply_provider_specific_extra_body() only handles
DashScope's enable_thinking and ignores MiMo entirely, causing MiMo
to default to thinking=enabled and return empty content field.
- Add _is_mimo_endpoint() to detect xiaomimimo.com hosts
- Send {"thinking": {"type": "disabled"}} for MiMo endpoints
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Xiaomi MiMo API (mimo-v2.5 / mimo-v2.5-pro) requires the
thinkingparameter as an object:{thinking: {type: disabled}}The current
_apply_provider_specific_extra_body()only handles DashScope'senable_thinkingboolean parameter. For MiMo endpoints, no thinking-related parameter is sent, causing MiMo to default tothinking: enabled. When thinking is enabled, MiMo returns the actual response inreasoning_contentwhilecontentis empty — breaking VLM memory extraction silently.Fix
_is_mimo_endpoint()method to detectxiaomimimo.comhosts (consistent with existing_supports_enable_thinking()pattern)_apply_provider_specific_extra_body(), send{thinking: {type: disabled}}for MiMo endpoints when thinking is disabledTesting
Verified with mimo-v2.5 API:
Without this patch, no thinking parameter is sent and MiMo defaults to enabled, causing empty
contentfor all VLM extractions.