Class: Luogu::CLI::Commands::Test

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/luogu/cli.rb

Instance Method Summary collapse

Instance Method Details

#call(prompt_file: nil, test_file: nil, **options) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/luogu/cli.rb', line 67

def call(prompt_file: nil, test_file:nil, **options)
  test_file ||= prompt_file.sub(File.extname(prompt_file), ".test.yml")

  chatgpt = ChatLLM.new(prompt_file, options.fetch(:out), options.fetch(:plugin, nil))
  messages = YAML.load_file(test_file)
  chatgpt.playload messages
end