Class: LittleGhost::Tools::Filesystem::ReadFile

Inherits:
LittleGhost::Tool show all
Defined in:
lib/little_ghost/tools/filesystem.rb

Overview

Reads one UTF-8 text file through the configured sandbox.

Direct Known Subclasses

ExclusiveReadFile

Instance Attribute Summary

Attributes inherited from LittleGhost::Tool

#context

Instance Method Summary collapse

Methods inherited from LittleGhost::Tool

#agent, 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

#class_attribute, included

Constructor Details

This class inherits a constructor from LittleGhost::Tool

Instance Method Details

#call(input) ⇒ Object

Returns the UTF-8 text at input through the sandbox.



29
30
31
# File 'lib/little_ghost/tools/filesystem.rb', line 29

def call(input)
  sandbox.read(input.fetch("path"), context:)
end