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

Function capabilitiesForModel

packages/oauth/src/managed-kimi-code.ts:219–241  ·  view source on GitHub ↗
(model: ManagedKimiCodeModelInfo)

Source from the content-addressed store, hash-verified

217}
218
219function capabilitiesForModel(model: ManagedKimiCodeModelInfo): string[] | undefined {
220 const caps = new Set<string>();
221 // supports_thinking_type is the full three-state declaration and wins over
222 // the legacy supports_reasoning boolean; absent (older servers) falls back.
223 switch (model.supportsThinkingType) {
224 case 'only':
225 caps.add('thinking');
226 caps.add('always_thinking');
227 break;
228 case 'both':
229 caps.add('thinking');
230 break;
231 case 'no':
232 break;
233 case undefined:
234 if (model.supportsReasoning) caps.add('thinking');
235 break;
236 }
237 if (model.supportsImageIn) caps.add('image_in');
238 if (model.supportsVideoIn) caps.add('video_in');
239 if (model.supportsToolUse ?? true) caps.add('tool_use');
240 return caps.size > 0 ? [...caps] : undefined;
241}
242
243function defaultBaseUrl(baseUrl: string | undefined): string {
244 return (baseUrl ?? kimiCodeBaseUrl()).replace(/\/+$/, '');

Callers 1

Calls 1

addMethod · 0.65

Tested by

no test coverage detected