Module: RubyLLM::Agents::DSL::Knowledge::InstanceMethods
- Included in:
- BaseAgent
- Defined in:
- lib/ruby_llm/agents/dsl/knowledge.rb
Overview
Instance methods mixed into agent instances via include.
Instance Method Summary collapse
-
#compiled_knowledge ⇒ String
Compiles all knowledge entries into a single string with headings and separators.
Instance Method Details
#compiled_knowledge ⇒ String
Compiles all knowledge entries into a single string with headings and separators.
94 95 96 97 98 99 100 101 102 |
# File 'lib/ruby_llm/agents/dsl/knowledge.rb', line 94 def compiled_knowledge self.class.knowledge_entries.filter_map { |entry| content = resolve_knowledge(entry) next if content.blank? heading = entry[:name].to_s.tr("_", " ").gsub(/\b\w/, &:upcase) "## #{heading}\n\n#{content}" }.join("\n\n---\n\n") end |