Class: LLMs::CLI::Base
- Inherits:
-
Object
- Object
- LLMs::CLI::Base
- Defined in:
- lib/llms/cli/base.rb
Direct Known Subclasses
Chat, TestAccess, TestImageSupport, TestPromptCaching, TestToolUse
Instance Attribute Summary collapse
-
#executor ⇒ Object
readonly
Returns the value of attribute executor.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(command_name, override_default_options = {}) ⇒ Base
constructor
A new instance of Base.
- #run ⇒ Object
Constructor Details
#initialize(command_name, override_default_options = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 |
# File 'lib/llms/cli/base.rb', line 8 def initialize(command_name, = {}) @command_name = command_name @options = .merge() end |
Instance Attribute Details
#executor ⇒ Object (readonly)
Returns the value of attribute executor.
6 7 8 |
# File 'lib/llms/cli/base.rb', line 6 def executor @executor end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/llms/cli/base.rb', line 6 def @options end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/llms/cli/base.rb', line 14 def run setup execute cleanup rescue LLMs::Error => e $stderr.puts "Error: #{e.}" exit 1 rescue StandardError => e $stderr.puts "Unexpected error: #{e.}" if @options[:debug] $stderr.puts e.backtrace end exit 1 end |