class RubyLLM::Prompt::Roots
The ordered directories searched for prompt files. The application’s prompt directory is always first, so an application can override any prompt an engine ships by placing a file at the same relative path. Engines append their own directory in an initializer:
initializer "my_engine.prompts" do RubyLLM::Prompt.roots << MyEngine::Engine.root.join("app/prompts") end
Public Instance Methods
Source
# File lib/ruby_llm/prompt.rb, line 27 def <<(path) @registered << Pathname.new(path) self end
Appends a prompt directory and returns self.
Also aliased as: push
Source
# File lib/ruby_llm/prompt.rb, line 34 def each(&) [@default.call, *@registered].each(&) end
Yields each prompt directory in lookup order. Returns an Enumerator without a block.