Class: RailsAgents::Generators::AgentGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/rails_agents/agent/agent_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_agent_directoryObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/rails_agents/agent/agent_generator.rb', line 23

def create_agent_directory
  empty_directory agent_path
  empty_directory File.join(agent_path, "tools")
  empty_directory File.join(agent_path, "skills")
  empty_directory File.join(agent_path, "knowledge")
  empty_directory File.join(agent_path, "connectors")
  empty_directory File.join(agent_path, "plugins")
  empty_directory File.join(agent_path, "channels")
  empty_directory File.join(agent_path, "evals")
end

#create_agent_filesObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/generators/rails_agents/agent/agent_generator.rb', line 34

def create_agent_files
  if database?
    template "agent_database.rb.tt", File.join(agent_path, "agent.rb")
    template "prompt_database.md.tt", File.join(agent_path, "prompt.md")
  else
    template "agent.rb.tt", File.join(agent_path, "agent.rb")
    template "prompt.md.tt", File.join(agent_path, "prompt.md")
  end
  template "memory.rb.tt", File.join(agent_path, "memory.rb")
  template "imports.yml.tt", File.join(agent_path, "imports.yml")
  template "channels/slack.rb.tt", File.join(agent_path, "channels/slack.rb")
  template "evals/smoke.yml.tt", File.join(agent_path, "evals/smoke.yml")
end