Class: Kward::Tools::ReadSkill

Inherits:
Base
  • Object
show all
Defined in:
lib/kward/tools/read_skill.rb

Overview

Tool wrapper for reading configured skill instructions.

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#schema

Constructor Details

#initializeReadSkill

Builds the tool schema and stores the execution dependency.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/kward/tools/read_skill.rb', line 11

def initialize
  super(
    "read_skill",
    "Read configured skill instructions/files.",
    properties: {
      name: { type: "string", description: "Skill name." },
      path: { type: "string", description: "Path inside skill; default SKILL.md." }
    },
    required: ["name"]
  )
end

Instance Method Details

#call(args, _conversation, cancellation: nil) ⇒ Object

Executes the tool and returns model-facing output text.



24
25
26
27
28
29
# File 'lib/kward/tools/read_skill.rb', line 24

def call(args, _conversation, cancellation: nil)
  name = argument(args, :name, "")
  path = argument(args, :path)

  ConfigFiles.read_skill_file(name, path)
end