Class: Chocomint::Tools::Base
- Inherits:
-
Object
- Object
- Chocomint::Tools::Base
- Defined in:
- lib/chocomint/tools/base.rb
Overview
ツールの共通インターフェース (DESIGN §7)。 call は必ず { exit_code:, stdout:, stderr:, duration_ms: } を返す。
Direct Known Subclasses
AppendFile, DeleteFile, Edit, FetchUrl, FileInfo, Glob, Grep, ListDir, Ls, MakeDir, ReadFile, RunCommand, Shell, WriteFile
Instance Method Summary collapse
- #call(_args) ⇒ Object
- #description ⇒ Object
- #name ⇒ Object
-
#schema ⇒ Object
json_schemer 用の JSON Schema (arguments の検証に使う)。.
-
#to_tool_definition ⇒ Object
Anthropic Messages API の tools 配列に渡す形式。.
Instance Method Details
#call(_args) ⇒ Object
17 18 19 |
# File 'lib/chocomint/tools/base.rb', line 17 def call(_args) raise NotImplementedError end |
#description ⇒ Object
30 31 32 |
# File 'lib/chocomint/tools/base.rb', line 30 def description "" end |
#name ⇒ Object
8 9 10 |
# File 'lib/chocomint/tools/base.rb', line 8 def name raise NotImplementedError end |
#schema ⇒ Object
json_schemer 用の JSON Schema (arguments の検証に使う)。
13 14 15 |
# File 'lib/chocomint/tools/base.rb', line 13 def schema raise NotImplementedError end |
#to_tool_definition ⇒ Object
Anthropic Messages API の tools 配列に渡す形式。
22 23 24 25 26 27 28 |
# File 'lib/chocomint/tools/base.rb', line 22 def to_tool_definition { "name" => name, "description" => description, "input_schema" => schema } end |