执行摘要
修复 MiMo-V2-Flash 模型推理解析错误,避免 API 响应中 message.content 为空。
PR body中描述:'MiMo-V2-Flash and similar models default enable_thinking to false in their chat templates, but qwen3-family requests without the flag are currently treated as reasoning-enabled, so /v1/chat/completions replies come back with message.content=null and the full answer in reasoning_content unless enable_thinking=false is passed explicitly.'
建议精读以理解推理解析器的设计模式,关注硬编码与通用解析逻辑的权衡;对于类似模型支持,可参考此PR作为案例。
gemini-code-assist[bot]指出字符串检查'"set enable_thinking = false" in chat_template'脆弱,建议使用正则表达式以提高健壮性;JustinTong0323评论说可能需要更优雅的方法,但可以先硬编码。最终代码未采纳建议,保持硬编码逻辑。
参与讨论