MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / capabilitiesForModel

Function capabilitiesForModel

packages/oauth/src/open-platform.ts:78–100  ·  view source on GitHub ↗
(model: ManagedKimiCodeModelInfo)

Source from the content-addressed store, hash-verified

76}
77
78export function capabilitiesForModel(model: ManagedKimiCodeModelInfo): string[] | undefined {
79 const caps = new Set<string>();
80 // supports_thinking_type is the full three-state declaration and wins over
81 // the legacy supports_reasoning boolean; absent (older servers) falls back.
82 switch (model.supportsThinkingType) {
83 case 'only':
84 caps.add('thinking');
85 caps.add('always_thinking');
86 break;
87 case 'both':
88 caps.add('thinking');
89 break;
90 case 'no':
91 break;
92 case undefined:
93 if (model.supportsReasoning) caps.add('thinking');
94 break;
95 }
96 if (model.supportsImageIn) caps.add('image_in');
97 if (model.supportsVideoIn) caps.add('video_in');
98 if (model.supportsToolUse ?? true) caps.add('tool_use');
99 return caps.size > 0 ? [...caps] : undefined;
100}
101
102export class OpenPlatformApiError extends Error {
103 readonly status: number;

Callers 3

applyOpenPlatformConfigFunction · 0.70

Calls 1

addMethod · 0.65

Tested by

no test coverage detected