R/tools-builtin.R
tool_write_file.Rd
A tool that writes content to a file, creating it if it doesn't exist.
tool_write_file(path, content, append = FALSE)
A tool definition created with ellmer::tool().
ellmer::tool()
Path to the file to write (tool argument)
Content to write to the file (tool argument)
If TRUE, append to existing file (tool argument)
if (FALSE) { # \dontrun{ agent <- Agent$new( chat = ellmer::chat("openai/gpt-4o"), tools = list(tool_write_file) ) } # }