(model: ManagedKimiCodeModelInfo)
| 217 | } |
| 218 | |
| 219 | function 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 | |
| 243 | function defaultBaseUrl(baseUrl: string | undefined): string { |
| 244 | return (baseUrl ?? kimiCodeBaseUrl()).replace(/\/+$/, ''); |
no test coverage detected