WriteConfig

org.llm4s.toolapi.builtin.filesystem.WriteConfig
case class WriteConfig(allowedPaths: Seq[String], maxFileSize: Long, allowOverwrite: Boolean, createDirectories: Boolean)

Configuration for write operations.

A path is judged by where it really is, as for FileConfig: symbolic links are resolved (for a file that does not exist yet, the nearest existing ancestor is), with a .. after a link read both the POSIX and the Windows way and both locations required to be allowed, then compared with each allowed entry one component at a time. A link inside an allowed directory that leads outside it is therefore refused, whether the link is a directory on the way to the file or the file itself; a link that leads to another place inside the allowed directory is written through. The tool writes to the resolved path.

Value parameters

allowOverwrite

Whether to allow overwriting existing files

allowedPaths

Paths where writing is allowed (required for safety)

createDirectories

Whether to create parent directories if they don't exist

maxFileSize

Maximum file size to write in bytes

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def isPathAllowed(path: Path): Boolean

Check if a path is allowed for writing, by its real location (see the class documentation).

Check if a path is allowed for writing, by its real location (see the class documentation).

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product