Class: Luo::CLI::InitBase

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/luo/cli/init_base.rb

Direct Known Subclasses

InitApp, InitNotebook

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



40
41
42
# File 'lib/luo/cli/init_base.rb', line 40

def self.source_root
  Pathname.new(File.join(__dir__, "../../../templates")).expand_path
end

Instance Method Details

#copy_agentsObject



24
25
26
27
28
# File 'lib/luo/cli/init_base.rb', line 24

def copy_agents
  say "Copying Agents Demo...", :green
  copy_file "time_agent.rb", "agents/time_agent.rb"
  copy_file "weather_agent.rb", "agents/weather_agent.rb"
end

#copy_envObject



30
31
32
33
# File 'lib/luo/cli/init_base.rb', line 30

def copy_env
  say "Copying luo.env...", :green
  copy_file "env", "luo.env"
end

#copy_filesObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/luo/cli/init_base.rb', line 13

def copy_files
  say "Copying OpenAI Prompts...", :green
  copy_file "prompts/agent_input.md.erb", "prompts/agent_input.md.erb"
  copy_file "prompts/agent_system.md.erb", "prompts/agent_system.md.erb"
  copy_file "prompts/agent_tool_input.md.erb", "prompts/agent_tool_input.md.erb"

  say "Copying Xinghuo Prompts...", :green
  copy_file "prompts/xinghuo_agent_input.md.erb", "prompts/xinghuo_agent_input.md.erb"
  copy_file "prompts/xinghuo_response_error.md.erb", "prompts/xinghuo_response_error.md.erb"
end

#copy_test_fileObject



35
36
37
38
# File 'lib/luo/cli/init_base.rb', line 35

def copy_test_file
  say "Copying test file...", :green
  copy_file "test.yml", "test.yml"
end

#create_dirtoriesObject



7
8
9
10
11
# File 'lib/luo/cli/init_base.rb', line 7

def create_dirtories
  say "Creating directories...", :green
  empty_directory("prompts")
  empty_directory("agents")
end