Class: RubyLLM::Generators::AgentGenerator

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

Overview

Generator for RubyLLM agent classes and prompt files.

Instance Method Summary collapse

Instance Method Details

#create_agent_fileObject



15
16
17
# File 'lib/generators/ruby_llm/agent/agent_generator.rb', line 15

def create_agent_file
  template 'agent.rb.tt', File.join('app/agents', class_path, "#{agent_file_name}.rb")
end

#create_prompt_fileObject



19
20
21
22
23
# File 'lib/generators/ruby_llm/agent/agent_generator.rb', line 19

def create_prompt_file
  empty_directory File.join('app/prompts', class_path, agent_file_name)
  template 'instructions.txt.erb.tt',
           File.join('app/prompts', class_path, agent_file_name, 'instructions.txt.erb')
end