fix(moonshot): add reasoning_content field support for Kimi models (#11806)

Kimi-K2.5 returns 400 errors when thinking is enabled because
reasoning_content is missing from assistant tool call messages.
This adds the supportsReasoningContentField flag (as a getter gated
on kimi-* models) matching the existing DeepSeek fix, so legacy
moonshot-v1-* models are unaffected.

Fixes #11600
Fixes #11711
This commit is contained in:
Dallin Romney 2026-03-25 10:29:40 -07:00 • committed by GitHub
parent f7437593fd
commit 3fdf35e0c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,13 @@ import OpenAI from "./OpenAI.js";
class Moonshot extends OpenAI {
static providerName = "moonshot";
constructor(options: LLMOptions) {
super(options);
this.supportsReasoningContentField =
this.model?.startsWith("kimi") ?? false;
}
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.moonshot.cn/v1/",
model: "moonshot-v1-8k",