Class: LittleGhost::Tools::Filesystem::ReplaceInFile
- Inherits:
-
LittleGhost::Tool
- Object
- LittleGhost::Tool
- LittleGhost::Tools::Filesystem::ReplaceInFile
- Defined in:
- lib/little_ghost/tools/filesystem.rb
Overview
Replaces one unique text occurrence through a writable sandbox.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from LittleGhost::Tool
Instance Method Summary collapse
-
#call(input) ⇒ Object
Replaces the one matching
old_textoccurrence atpath.
Methods inherited from LittleGhost::Tool
#agent, #close, define, description, #description, exclusive, #exclusive?, #execute, #initialize, input_schema, #input_schema, #model, #run, #runtime, #sandbox, specification, #specification, tool_name, #tool_name, #workspace
Methods included from Support::ClassAttributes
Constructor Details
This class inherits a constructor from LittleGhost::Tool
Instance Method Details
#call(input) ⇒ Object
Replaces the one matching old_text occurrence at path.
71 72 73 |
# File 'lib/little_ghost/tools/filesystem.rb', line 71 def call(input) sandbox.replace(input.fetch("path"), input.fetch("old_text"), input.fetch("new_text"), context:) end |