Class: Ask::Agent::ContextSources::AlwaysActiveSkills

Inherits:
Ask::Agent::ContextSource show all
Defined in:
lib/ask/agent/context_sources.rb

Overview

Full instructions for always-active skills (those with always: true).

Instance Method Summary collapse

Methods inherited from Ask::Agent::ContextSource

inherited, key, #key, registered_sources, #update

Constructor Details

#initialize(registry) ⇒ AlwaysActiveSkills

Returns a new instance of AlwaysActiveSkills.



51
52
53
# File 'lib/ask/agent/context_sources.rb', line 51

def initialize(registry)
  @registry = registry
end

Instance Method Details

#baseline(instructions) ⇒ Object



63
64
65
# File 'lib/ask/agent/context_sources.rb', line 63

def baseline(instructions)
  instructions.empty? ? nil : instructions
end

#loadObject



55
56
57
58
59
60
61
# File 'lib/ask/agent/context_sources.rb', line 55

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