Class: LLM::Shell::Tools::WriteFile
- Inherits:
-
Tool
- Object
- Tool
- LLM::Shell::Tools::WriteFile
show all
- Defined in:
- lib/llm/shell/tools/write_file.rb
Instance Method Summary
collapse
Methods inherited from Tool
description, function, inherited, lock, name, params
#builtin?, #disable!, #enable!, #enabled?
#param
Instance Method Details
#call(path:, content:) ⇒ Object
10
11
12
13
14
|
# File 'lib/llm/shell/tools/write_file.rb', line 10
def call(path:, content:)
{ok: true, content: File.binwrite(path, content)}
rescue => ex
{ok: false, error: {class: ex.class.to_s, message: ex.message}}
end
|