(...models: readonly (string | undefined)[])
| 370 | } |
| 371 | |
| 372 | function requireConfiguredModel(...models: readonly (string | undefined)[]): string { |
| 373 | const model = configuredModel(...models); |
| 374 | if (model === undefined) { |
| 375 | throw new Error( |
| 376 | 'No model configured. Run `kimi` and use /login to sign in, then retry; or set default_model in config.toml.', |
| 377 | ); |
| 378 | } |
| 379 | return model; |
| 380 | } |
| 381 | |
| 382 | function configuredModel(...models: readonly (string | undefined)[]): string | undefined { |
| 383 | return models.find((model) => model !== undefined && model.trim().length > 0); |
no test coverage detected