Module: RubyLLM::Skills::ChatExtensions
- Defined in:
- lib/ruby_llm/skills/chat_extensions.rb
Overview
Extensions for RubyLLM::Chat to enable skill integration.
Instance Method Summary collapse
-
#with_skills(*sources, only: nil) ⇒ self
Add skills to this chat.
Instance Method Details
#with_skills(*sources, only: nil) ⇒ self
Add skills to this chat.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ruby_llm/skills/chat_extensions.rb', line 27 def with_skills(*sources, only: nil) sources = [RubyLLM::Skills.default_path] if sources.empty? loaders = sources.map { |s| to_loader(s) } loader = (loaders.length == 1) ? loaders.first : RubyLLM::Skills.compose(*loaders) loader = FilteredLoader.new(loader, only) if only skill_tool = RubyLLM::Skills::SkillTool.new(loader) with_tool(skill_tool) end |