Class: SharedTools::Tools::Disk::FileCreateTool
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- SharedTools::Tools::Disk::FileCreateTool
- Defined in:
- lib/shared_tools/tools/disk/file_create_tool.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
- #execute(path:) ⇒ String
-
#initialize(driver: nil, logger: nil) ⇒ FileCreateTool
constructor
A new instance of FileCreateTool.
Constructor Details
#initialize(driver: nil, logger: nil) ⇒ FileCreateTool
Returns a new instance of FileCreateTool.
20 21 22 23 |
# File 'lib/shared_tools/tools/disk/file_create_tool.rb', line 20 def initialize(driver: nil, logger: nil) @driver = driver || SharedTools::Tools::Disk::LocalDriver.new(root: Dir.pwd) @logger = logger || RubyLLM.logger end |
Class Method Details
.name ⇒ Object
12 |
# File 'lib/shared_tools/tools/disk/file_create_tool.rb', line 12 def self.name = 'disk_file_create' |
Instance Method Details
#execute(path:) ⇒ String
28 29 30 31 32 33 34 |
# File 'lib/shared_tools/tools/disk/file_create_tool.rb', line 28 def execute(path:) @logger.info("#{self.class.name}#execute path=#{path.inspect}") @driver.file_create(path:) rescue SecurityError => e @logger.error(e.) raise e end |