Class: Gemlings::FileRead
Constant Summary collapse
- MAX_CHARS =
50_000
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:) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/gemlings/tools/file_read.rb', line 12 def call(path:) = File.(path) content = File.read() content.length > MAX_CHARS ? content[0, MAX_CHARS] : content rescue => e "Error reading #{path}: #{e.message}" end |