Class: RubyLLM::Skills::CompositeLoader
- Defined in:
- lib/ruby_llm/skills/composite_loader.rb
Overview
Combines multiple loaders into a single source.
Skills are searched in order, with earlier loaders taking precedence. This allows layering skills from multiple sources (filesystem, database, etc).
Instance Attribute Summary collapse
-
#loaders ⇒ Object
readonly
Returns the value of attribute loaders.
Instance Method Summary collapse
-
#initialize(loaders) ⇒ CompositeLoader
constructor
Initialize with an array of loaders.
-
#list ⇒ Array<Skill>
List all skills from all loaders.
-
#reload! ⇒ self
Reload all loaders.
Methods inherited from Loader
Constructor Details
#initialize(loaders) ⇒ CompositeLoader
Initialize with an array of loaders.
23 24 25 26 |
# File 'lib/ruby_llm/skills/composite_loader.rb', line 23 def initialize(loaders) super() @loaders = loaders end |
Instance Attribute Details
#loaders ⇒ Object (readonly)
Returns the value of attribute loaders.
18 19 20 |
# File 'lib/ruby_llm/skills/composite_loader.rb', line 18 def loaders @loaders end |
Instance Method Details
#list ⇒ Array<Skill>
List all skills from all loaders. Skills are deduplicated by name, with earlier loaders taking precedence.
32 33 34 |
# File 'lib/ruby_llm/skills/composite_loader.rb', line 32 def list skills end |
#reload! ⇒ self
Reload all loaders.
39 40 41 42 |
# File 'lib/ruby_llm/skills/composite_loader.rb', line 39 def reload! @loaders.each(&:reload!) super end |