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)
| 323 | // With no argument it reports the current override. It delegates to |
| 324 | // handleSwitchCommand so parsing, validation and messaging stay in one place. |
| 325 | func (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 |
no test coverage detected