Class: OmniAI::CLI::BaseHandler
- Inherits:
-
Object
- Object
- OmniAI::CLI::BaseHandler
- Defined in:
- lib/omniai/cli/base_handler.rb
Overview
A generic handler for CLI commands (e.g. ‘omnia chat’).
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #handle!(argv:) ⇒ Object
-
#initialize(stdin: $stdin, stdout: $stdout, provider: 'openai') ⇒ BaseHandler
constructor
A new instance of BaseHandler.
Constructor Details
#initialize(stdin: $stdin, stdout: $stdout, provider: 'openai') ⇒ BaseHandler
Returns a new instance of BaseHandler.
18 19 20 21 22 23 |
# File 'lib/omniai/cli/base_handler.rb', line 18 def initialize(stdin: $stdin, stdout: $stdout, provider: 'openai') @stdin = stdin @stdout = stdout @provider = provider @args = {} end |
Class Method Details
.handle!(argv:, stdin: $stdin, stdout: $stdout, provider: 'openai') ⇒ Object
11 12 13 |
# File 'lib/omniai/cli/base_handler.rb', line 11 def self.handle!(argv:, stdin: $stdin, stdout: $stdout, provider: 'openai') new(stdin:, stdout:, provider:).handle!(argv:) end |
Instance Method Details
#handle!(argv:) ⇒ Object
26 27 28 |
# File 'lib/omniai/cli/base_handler.rb', line 26 def handle!(argv:) raise NotImplementedError, "#{self.class}#handle! undefined" end |