ReadFileTool

org.llm4s.toolapi.builtin.filesystem.ReadFileTool
object ReadFileTool

Tool for reading file contents.

Features:

  • Configurable size limits
  • Path restrictions for security
  • Optional line limit
  • Encoding detection

Attributes

Example
import org.llm4s.toolapi.builtin.filesystem._
val readTool = ReadFileTool.create(FileConfig(
 maxFileSize = 512 * 1024,
 allowedPaths = Some(Seq("/tmp", "/home/user/workspace"))
))
val tools = new ToolRegistry(Seq(readTool))
agent.run("Read the contents of /tmp/data.txt", tools)
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def create(config: FileConfig): ToolFunction[Map[String, Any], ReadFileResult]

Create a read file tool with the given configuration.

Create a read file tool with the given configuration.

Attributes

Concrete fields

val tool: ToolFunction[Map[String, Any], ReadFileResult]

Default read file tool with standard configuration.

Default read file tool with standard configuration.

Attributes