WriteFileTool
org.llm4s.toolapi.builtin.filesystem.WriteFileTool
object WriteFileTool
Tool for writing file contents.
IMPORTANT: This tool requires explicit path allowlisting for safety. It will not write to any path that is not in the allowedPaths list.
Features:
- Requires explicit path allowlist
- Optional append mode
- Auto-creates parent directories
- Size limits
Attributes
- Example
-
import org.llm4s.toolapi.builtin.filesystem._ val writeTool = WriteFileTool.create(WriteConfig( allowedPaths = Seq("/tmp", "/home/user/output") )) val tools = new ToolRegistry(Seq(writeTool)) agent.run("Write 'Hello World' to /tmp/output.txt", tools) - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
WriteFileTool.type
Members list
In this article