class

Tools::FileManagement::SearchFilesTool::Runner

Inherits Tools::FileHelper < LLM::Function::Runner < Reference < Object

The Runner class executes the function

Constants

MAX_FILE_SIZE_FOR_SEARCH = (2 * 1024) * 1024

Files larger than this are skipped: reading them line-by-line risks huge in-memory allocations on "lines" (binary blobs between newlines) and their matches would be useless to an LLM anyway.

MAX_MATCHES_PER_FILE = 50

Cap per file so one file cannot dominate the tool response.

Instance methods

execute(args : JSON::Any) : String

Implement this method to handle the LLM function call, and return

  • EITHER a String with the JSON value,
  • OR a Reply if you need to return attachments.
Source