Class: Riffer::Skills::Adapter
- Inherits:
-
Object
- Object
- Riffer::Skills::Adapter
- Defined in:
- lib/riffer/skills/adapter.rb
Overview
Base class defining the interface for skill adapters.
A skill adapter encapsulates the provider-specific behavior for skills: how the skill catalog is rendered in the system prompt, and which tool the LLM calls to activate a skill.
Subclass and override render_catalog and optionally activate_tool to customize behavior.
See Riffer::Skills::MarkdownAdapter for the default implementation. See Riffer::Skills::XmlAdapter for the Anthropic/Claude variant.
Direct Known Subclasses
Instance Method Summary collapse
-
#activate_tool ⇒ Object
Returns the tool class used to activate skills.
-
#render_catalog(skills) ⇒ Object
Renders a skill catalog section for the system prompt.
Instance Method Details
#activate_tool ⇒ Object
Returns the tool class used to activate skills.
Override to provide a custom activation tool.
– : () -> singleton(Riffer::Tool)
34 35 36 |
# File 'lib/riffer/skills/adapter.rb', line 34 def activate_tool Riffer::Skills::ActivateTool end |
#render_catalog(skills) ⇒ Object
Renders a skill catalog section for the system prompt.
- skills
-
array of Frontmatter objects to render.
Raises NotImplementedError if not implemented by subclass.
– : (Array) -> String
24 25 26 |
# File 'lib/riffer/skills/adapter.rb', line 24 def render_catalog(skills) raise NotImplementedError, "#{self.class} must implement #render_catalog" end |