R/tools-builtin.R
tool_read_file.Rd
A tool that reads the contents of a file and returns it as a string.
tool_read_file(path, pages = NULL)
A tool definition created with ellmer::tool().
ellmer::tool()
Path to the file to read (tool argument, not R function argument)
Optional PDF page selection. Accepts comma-separated pages and ranges (e.g. "1,3-5"). Only supported for PDF files.
"1,3-5"
if (FALSE) { # \dontrun{ agent <- Agent$new( chat = ellmer::chat("openai/gpt-4o"), tools = list(tool_read_file) ) } # }