Class: Rubyagents::FileWrite
- Defined in:
- lib/rubyagents/tools/file_write.rb
Instance Method Summary collapse
Methods inherited from Tool
description, inherited, input, inputs, output_type, to_prompt, to_schema, tool_name
Instance Method Details
#call(path:, content:) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/rubyagents/tools/file_write.rb', line 13 def call(path:, content:) = File.(path) FileUtils.mkdir_p(File.dirname()) File.write(, content) "Successfully wrote #{content.length} bytes to #{}" rescue => e "Error writing #{path}: #{e.}" end |