Class: TheLocal::Collector
- Inherits:
-
Object
- Object
- TheLocal::Collector
- Defined in:
- lib/the_local/registry.rb
Overview
Yielded to a provider’s register block. Turns each ‘agent` call into an Agent tagged with the providing gem and namespaced under its prefix.
Instance Method Summary collapse
- #agent(name, description:, tools:, body:, knowledge: nil) ⇒ Object
-
#initialize(gem_name, prefix, registry, agents_dir: nil) ⇒ Collector
constructor
A new instance of Collector.
Constructor Details
#initialize(gem_name, prefix, registry, agents_dir: nil) ⇒ Collector
Returns a new instance of Collector.
36 37 38 39 40 41 |
# File 'lib/the_local/registry.rb', line 36 def initialize(gem_name, prefix, registry, agents_dir: nil) @gem_name = gem_name @prefix = prefix @registry = registry @agents_dir = agents_dir end |
Instance Method Details
#agent(name, description:, tools:, body:, knowledge: nil) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/the_local/registry.rb', line 43 def agent(name, description:, tools:, body:, knowledge: nil) @registry.add( Agent.new(gem_name: @gem_name, prefix: @prefix, name: name, description: description, tools: tools, body: body, knowledge: knowledge, source_path: source_path_for(name)) ) end |