Skip to contents

A tool that reads the contents of a file and returns it as a string.

Usage

tool_read_file(path)

Format

A tool definition created with ellmer::tool().

Arguments

path

Path to the file to read (tool argument, not R function argument)

Examples

if (FALSE) { # \dontrun{
agent <- Agent$new(
  chat = ellmer::chat("openai/gpt-4o"),
  tools = list(tool_read_file)
)
} # }