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

Function showModelPicker

apps/kimi-code/src/tui/commands/config.ts:360–388  ·  view source on GitHub ↗
(host: SlashCommandHost, selectedValue: string = host.state.appState.model)

Source from the content-addressed store, hash-verified

358}
359
360export function showModelPicker(host: SlashCommandHost, selectedValue: string = host.state.appState.model): void {
361 const entries = Object.entries(host.state.appState.availableModels);
362 if (entries.length === 0) {
363 host.showNotice(
364 'No models configured',
365 'Run /login to sign in to Kimi, or /provider to add another provider from a model catalog.',
366 );
367 return;
368 }
369 host.mountEditorReplacement(
370 new TabbedModelSelectorComponent({
371 models: host.state.appState.availableModels,
372 currentValue: host.state.appState.model,
373 selectedValue,
374 currentThinkingEffort: host.state.appState.thinkingEffort,
375 onSelect: ({ alias, thinking }) => {
376 host.restoreEditor();
377 void performModelSwitch(host, alias, thinking, true);
378 },
379 onSessionOnlySelect: ({ alias, thinking }) => {
380 host.restoreEditor();
381 void performModelSwitch(host, alias, thinking, false);
382 },
383 onCancel: () => {
384 host.restoreEditor();
385 },
386 }),
387 );
388}
389
390async function performModelSwitch(
391 host: SlashCommandHost,

Callers 2

handleModelCommandFunction · 0.85
handleSettingsSelectionFunction · 0.85

Calls 4

performModelSwitchFunction · 0.85
showNoticeMethod · 0.65
restoreEditorMethod · 0.65

Tested by

no test coverage detected