Class: OmniAI::CLI::ChatHandler

Inherits:
BaseHandler show all
Defined in:
lib/omniai/cli/chat_handler.rb

Overview

Used by CLI to process commands like:

omniai chat
omniai chat "What is the capital of France?"
omniai chat --provider="google" --model="gemini-2.0-flash" "Who are you?"

Instance Method Summary collapse

Methods inherited from BaseHandler

handle!, #initialize

Constructor Details

This class inherits a constructor from OmniAI::CLI::BaseHandler

Instance Method Details

#handle!(argv:) ⇒ Object

Parameters:

  • argv (Array<String>)


12
13
14
15
16
17
18
19
20
# File 'lib/omniai/cli/chat_handler.rb', line 12

def handle!(argv:)
  parser.parse!(argv)

  if argv.empty?
    listen!
  else
    chat(prompt: argv.join(" "))
  end
end