Class: RubynCode::CLI::Commands::Effort
- Inherits:
-
Base
- Object
- Base
- RubynCode::CLI::Commands::Effort
show all
- Defined in:
- lib/rubyn_code/cli/commands/effort.rb
Overview
Set or clear the reasoning effort level (output_config.effort).
/effort # show current value
/effort off # clear back to model default
/effort <level> # low | medium | high | xhigh | max
Constant Summary
collapse
- LEVELS =
%w[low medium high xhigh max].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
aliases, all_names, hidden?
Class Method Details
.command_name ⇒ Object
14
|
# File 'lib/rubyn_code/cli/commands/effort.rb', line 14
def self.command_name = '/effort'
|
.description ⇒ Object
15
|
# File 'lib/rubyn_code/cli/commands/effort.rb', line 15
def self.description = 'Set reasoning effort (low/medium/high/xhigh/max)'
|
Instance Method Details
#execute(args, ctx) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/rubyn_code/cli/commands/effort.rb', line 17
def execute(args, ctx)
arg = args.first
current = ctx.llm_client.respond_to?(:effort) ? ctx.llm_client.effort : nil
case arg
when nil
show_status(current, ctx)
when 'off'
ctx.llm_client.effort = nil
ctx.renderer.info('Reasoning effort cleared — using model default 🎚️')
when *LEVELS
ctx.llm_client.effort = arg
ctx.renderer.info("Reasoning effort set to #{arg} 🎚️")
else
ctx.renderer.warning("Usage: /effort [off|#{LEVELS.join('|')}]. Got: #{arg}")
end
end
|