Class: OllamaAgent::Skills::Runner
- Inherits:
-
Object
- Object
- OllamaAgent::Skills::Runner
- Defined in:
- lib/ollama_agent/skills/runner.rb
Overview
Composes a deterministic pipeline of skills. Each skill receives the output of the previous one merged into the original input, so downstream skills can chain on prior results without losing context.
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(steps, llm: nil) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(steps, llm: nil) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 |
# File 'lib/ollama_agent/skills/runner.rb', line 11 def initialize(steps, llm: nil) raise ArgumentError, "pipeline must contain at least one skill" if steps.empty? @skills = steps.map { |s| build_skill(s, llm: llm) } end |
Instance Method Details
#call(input) ⇒ Object
17 18 19 |
# File 'lib/ollama_agent/skills/runner.rb', line 17 def call(input) @skills.reduce(input) { |acc, skill| acc.merge(skill.call(acc)) } end |