Class: Kward::Tools::ReadSkill

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

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#schema

Constructor Details

#initializeReadSkill

Returns a new instance of ReadSkill.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/kward/tools/read_skill.rb', line 7

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



19
20
21
22
23
24
# File 'lib/kward/tools/read_skill.rb', line 19

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

  ConfigFiles.read_skill_file(name, path)
end