Class: CLAI::Commands::Chat

Inherits:
Object
  • Object
show all
Defined in:
lib/clai/commands/chat.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Chat

Returns a new instance of Chat.



4
5
6
# File 'lib/clai/commands/chat.rb', line 4

def initialize(config)
  @config = config
end

Instance Method Details

#chat(prompt, persona: 'default') ⇒ Object



8
9
10
11
# File 'lib/clai/commands/chat.rb', line 8

def chat(prompt, persona: 'default')
  system_prompts = @config.personas.fetch(persona, [])
  HTTPClient.new(@config).chat(prompt, system_prompts: system_prompts)
end