Class: Ask::Agent::ContextSources::AlwaysActiveSkills
- Inherits:
-
Ask::Agent::ContextSource
- Object
- Ask::Agent::ContextSource
- Ask::Agent::ContextSources::AlwaysActiveSkills
- Defined in:
- lib/ask/agent/context_sources.rb
Overview
Full instructions for always-active skills (those with always: true).
Instance Method Summary collapse
- #baseline(instructions) ⇒ Object
-
#initialize(registry) ⇒ AlwaysActiveSkills
constructor
A new instance of AlwaysActiveSkills.
- #load ⇒ Object
Methods inherited from Ask::Agent::ContextSource
inherited, key, #key, registered_sources, #update
Constructor Details
#initialize(registry) ⇒ AlwaysActiveSkills
Returns a new instance of AlwaysActiveSkills.
50 51 52 |
# File 'lib/ask/agent/context_sources.rb', line 50 def initialize(registry) @registry = registry end |
Instance Method Details
#baseline(instructions) ⇒ Object
62 63 64 |
# File 'lib/ask/agent/context_sources.rb', line 62 def baseline(instructions) instructions.empty? ? nil : instructions end |
#load ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/ask/agent/context_sources.rb', line 54 def load return "" unless @registry @registry.always_active_skills.map { |s| "## Skill: #{s.name}\n#{s.description}\n\n#{s.instructions}" }.join("\n\n") end |