Class: LLM::Shell::Command::DisableTool
- Inherits:
-
LLM::Shell::Command
- Object
- LLM::Shell::Command
- LLM::Shell::Command::DisableTool
- Defined in:
- lib/llm/shell/commands/disable_tool.rb
Constant Summary collapse
- Error =
Class.new(RuntimeError)
Class Method Summary collapse
-
.complete(name) ⇒ Array<String>
Completes a tool name.
Instance Method Summary collapse
-
#call(name) ⇒ void
Disables the given tool.
Methods inherited from LLM::Shell::Command
builtin?, description, enabled?, inherited, #initialize, name
Constructor Details
This class inherits a constructor from LLM::Shell::Command
Class Method Details
Instance Method Details
#call(name) ⇒ void
This method returns an undefined value.
Disables the given tool.
23 24 25 26 27 28 29 30 31 |
# File 'lib/llm/shell/commands/disable_tool.rb', line 23 def call(name) tool = LLM::Shell.tools.find { _1.name == name } if tool tool.disable! io.rewind.print("tool disabled").end else raise Error, "unknown tool: #{name}" end end |