Class: Luogu::CLI::Commands::Generate

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

Instance Method Summary collapse

Instance Method Details

#call(json_file: nil, prompt_file: nil) ⇒ Object



50
51
52
53
54
55
# File 'lib/luogu/cli.rb', line 50

def call(json_file: nil, prompt_file: nil, **)
  json = JSON.parse(File.read(json_file), symbolize_names: true)
  prompt_file ||=  json_file.sub(File.extname(json_file), ".md")

  chatgpt = ChatLLM.save(json, prompt_file)
end