MCPcopy Create free account
hub / github.com/diillson/chatcli / handleModelCommand

Method handleModelCommand

cli/cli_llm.go:339–346  ·  view source on GitHub ↗

handleModelCommand is a shorthand for `/switch --model `: it changes only the model of the current provider without the longer flag form. With no argument it lists the available models (same as bare `/switch --model`). It delegates to handleSwitchCommand so model-cache refresh, error handling

(ctx context.Context, input string)

Source from the content-addressed store, hash-verified

337// delegates to handleSwitchCommand so model-cache refresh, error handling and
338// the gateway runtime-state mirror all stay in one place.
339func (cli *ChatCLI) handleModelCommand(ctx context.Context, input string) {
340 rest := strings.TrimSpace(strings.TrimPrefix(input, "/model"))
341 if rest == "" {
342 cli.handleSwitchCommand(ctx, "/switch --model")
343 return
344 }
345 cli.handleSwitchCommand(ctx, "/switch --model "+rest)
346}
347
348func (cli *ChatCLI) handleSwitchCommand(ctx context.Context, userInput string) {
349 args := strings.Fields(userInput)

Callers 1

buildRoutesMethod · 0.80

Calls 1

handleSwitchCommandMethod · 0.95

Tested by

no test coverage detected