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.



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

#loadObject



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