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

Function requireConfiguredModel

apps/kimi-code/src/cli/run-prompt.ts:372–380  ·  view source on GitHub ↗
(...models: readonly (string | undefined)[])

Source from the content-addressed store, hash-verified

370}
371
372function 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
382function configuredModel(...models: readonly (string | undefined)[]): string | undefined {
383 return models.find((model) => model !== undefined && model.trim().length > 0);

Callers 2

runHeadlessGoalFunction · 0.85
resolvePromptSessionFunction · 0.85

Calls 1

configuredModelFunction · 0.85

Tested by

no test coverage detected