feat: add kimi-k2.7-code and glm-5.2 models

- Add Kimi kimi-k2.7-code (default), kimi-k2.7-code-highspeed, and GLM glm-5.2 (default)
- Fix 400 error when disabling thinking on kimi-k2.7-code; omit the thinking param for this series since it only accepts type=enabled
- Update README, docs (zh/en/ja), install scripts, and Web console model dropdown
This commit is contained in:
zhayujie
2026-06-17 11:54:35 +08:00
parent e3dce45b2a
commit 70c1c44d15
17 changed files with 60 additions and 46 deletions

View File

@@ -47,9 +47,20 @@ class MoonshotBot(Bot):
return model == "kimi-for-coding" or "api.kimi.com/coding" in base
@staticmethod
def _model_supports_thinking(model_name: str) -> bool:
"""Return True if the model supports the ``thinking`` request parameter."""
def _is_builtin_reasoning_model(model_name: str) -> bool:
"""Return True for Kimi code models with built-in reasoning.
These models only accept thinking type=enabled and reject disabled,
so the thinking param must be omitted entirely.
"""
return model_name.lower().startswith("kimi-k2.7-code")
@classmethod
def _model_supports_thinking(cls, model_name: str) -> bool:
"""Return True if the model accepts the ``thinking`` request parameter."""
m = model_name.lower()
if cls._is_builtin_reasoning_model(m):
return False
return m.startswith("kimi-k2") or m.startswith("kimi-k1.5")
def _build_headers(self) -> dict: