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

Method handleMaxTokensCommand

cli/cli_llm.go:325–332  ·  view source on GitHub ↗

handleMaxTokensCommand is a shorthand for `/switch --max-tokens `: it caps the model's output tokens for the session without the longer flag form. With no argument it reports the current override. It delegates to handleSwitchCommand so parsing, validation and messaging stay in one place.

(ctx context.Context, input string)

Source from the content-addressed store, hash-verified

323// With no argument it reports the current override. It delegates to
324// handleSwitchCommand so parsing, validation and messaging stay in one place.
325func (cli *ChatCLI) handleMaxTokensCommand(ctx context.Context, input string) {
326 rest := strings.TrimSpace(strings.TrimPrefix(input, "/max-tokens"))
327 if rest == "" {
328 fmt.Println(i18n.T("cli.maxtokens.current", cli.UserMaxTokens))
329 return
330 }
331 cli.handleSwitchCommand(ctx, "/switch --max-tokens "+rest)
332}
333
334// handleModelCommand is a shorthand for `/switch --model <name>`: it changes
335// only the model of the current provider without the longer flag form. With no

Callers 1

buildRoutesMethod · 0.80

Calls 2

handleSwitchCommandMethod · 0.95
TFunction · 0.92

Tested by

no test coverage detected