cayu.tools.files
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
ArtifactReader
Section titled “ArtifactReader”from cayu.tools import ArtifactReaderExtension point for artifact-specific read behavior.
Bases: Protocol.
can_read (method)
Section titled “can_read (method)”ArtifactReader.can_read(artifact: ArtifactMetadata) -> boolReturn true when this reader handles the artifact.
read (method)
Section titled “read (method)”async ArtifactReader.read(request: ArtifactReadRequest) -> ToolResultRead the artifact and return a model-facing tool result.
Release source · Runtime guarantees · Capability guides
ArtifactReadRequest
Section titled “ArtifactReadRequest”from cayu.tools import ArtifactReadRequestDecorators: @dataclass(frozen=True).
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
ctx |
ToolContext |
required |
artifact_store |
ArtifactStore |
required |
artifact |
ArtifactMetadata |
required |
initial_read |
ArtifactReadResult |
required |
options |
ReadFileOptions |
required |
structured |
dict |
required |
Release source · Runtime guarantees · Capability guides
default_artifact_readers
Section titled “default_artifact_readers”from cayu.tools import default_artifact_readersdefault_artifact_readers() -> tuple[ArtifactReader, ...]Release source · Runtime guarantees · Capability guides
DeleteFileTool
Section titled “DeleteFileTool”from cayu.tools import DeleteFileToolDelete one workspace file only when its content precondition matches.
Bases: Tool.
init (method)
Section titled “init (method)”DeleteFileTool.__init__(spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”DeleteFileTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”DeleteFileTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”DeleteFileTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”DeleteFileTool.description() -> strschema (property)
Section titled “schema (property)”DeleteFileTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async DeleteFileTool.run(ctx: ToolContext, args: dict) -> ToolResultRelease source · Runtime guarantees · Capability guides
EditFileTool
Section titled “EditFileTool”from cayu.tools import EditFileToolApply exact text replacements to one existing workspace file.
Bases: Tool.
init (method)
Section titled “init (method)”EditFileTool.__init__(spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”EditFileTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”EditFileTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”EditFileTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”EditFileTool.description() -> strschema (property)
Section titled “schema (property)”EditFileTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async EditFileTool.run(ctx: ToolContext, args: dict) -> ToolResultRelease source · Runtime guarantees · Capability guides
ImageArtifactReader
Section titled “ImageArtifactReader”from cayu.tools import ImageArtifactReadercan_read (method)
Section titled “can_read (method)”ImageArtifactReader.can_read(artifact: ArtifactMetadata) -> boolread (method)
Section titled “read (method)”async ImageArtifactReader.read(request: ArtifactReadRequest) -> ToolResultRelease source · Runtime guarantees · Capability guides
ListArtifactsTool
Section titled “ListArtifactsTool”from cayu.tools import ListArtifactsToolBases: Tool.
init (method)
Section titled “init (method)”ListArtifactsTool.__init__(spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”ListArtifactsTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”ListArtifactsTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”ListArtifactsTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”ListArtifactsTool.description() -> strschema (property)
Section titled “schema (property)”ListArtifactsTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async ListArtifactsTool.run(ctx: ToolContext, args: dict) -> ToolResultRelease source · Runtime guarantees · Capability guides
ListFilesTool
Section titled “ListFilesTool”from cayu.tools import ListFilesToolBases: Tool.
init (method)
Section titled “init (method)”ListFilesTool.__init__(*, exclude_directories: Iterable[str]=(), max_scan_entries: int=DEFAULT_LIST_SCAN_LIMIT) -> Nonename (property)
Section titled “name (property)”ListFilesTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”ListFilesTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”ListFilesTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”ListFilesTool.description() -> strschema (property)
Section titled “schema (property)”ListFilesTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async ListFilesTool.run(ctx: ToolContext, args: dict) -> ToolResultRelease source · Runtime guarantees · Capability guides
PdfArtifactReader
Section titled “PdfArtifactReader”from cayu.tools import PdfArtifactReadercan_read (method)
Section titled “can_read (method)”PdfArtifactReader.can_read(artifact: ArtifactMetadata) -> boolread (method)
Section titled “read (method)”async PdfArtifactReader.read(request: ArtifactReadRequest) -> ToolResultRelease source · Runtime guarantees · Capability guides
ReadFileOptions
Section titled “ReadFileOptions”from cayu.tools import ReadFileOptionsDecorators: @dataclass(frozen=True).
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
max_bytes |
int |
DEFAULT_READ_LIMIT_BYTES |
max_attachment_bytes |
int |
DEFAULT_ATTACHMENT_LIMIT_BYTES |
max_attachment_validation_bytes |
int |
DEFAULT_MAX_ATTACHMENT_LIMIT_BYTES |
pages |
str | None |
None |
image_region |
tuple[int, int, int, int] | None |
None |
offset |
int |
0 |
Release source · Runtime guarantees · Capability guides
ReadFileTool
Section titled “ReadFileTool”from cayu.tools import ReadFileToolBases: Tool.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
spec |
class attribute |
_read_file_tool_spec(default_attachment_limit_bytes=DEFAULT_ATTACHMENT_LIMIT_BYTES, max_attachment_limit_bytes=DEFAULT_MAX_ATTACHMENT_LIMIT_BYTES) |
init (method)
Section titled “init (method)”ReadFileTool.__init__(*, extra_artifact_readers: Iterable[ArtifactReader] | None=None, artifact_readers: Iterable[ArtifactReader] | None=None, default_attachment_limit_bytes: int=DEFAULT_ATTACHMENT_LIMIT_BYTES, max_attachment_limit_bytes: int=DEFAULT_MAX_ATTACHMENT_LIMIT_BYTES, spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”ReadFileTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”ReadFileTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”ReadFileTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”ReadFileTool.description() -> strschema (property)
Section titled “schema (property)”ReadFileTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async ReadFileTool.run(ctx: ToolContext, args: dict) -> ToolResultRelease source · Runtime guarantees · Capability guides
TextArtifactReader
Section titled “TextArtifactReader”from cayu.tools import TextArtifactReadercan_read (method)
Section titled “can_read (method)”TextArtifactReader.can_read(artifact: ArtifactMetadata) -> boolread (method)
Section titled “read (method)”async TextArtifactReader.read(request: ArtifactReadRequest) -> ToolResultRelease source · Runtime guarantees · Capability guides
WriteFileTool
Section titled “WriteFileTool”from cayu.tools import WriteFileToolBases: Tool.
init (method)
Section titled “init (method)”WriteFileTool.__init__(spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”WriteFileTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”WriteFileTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”WriteFileTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”WriteFileTool.description() -> strschema (property)
Section titled “schema (property)”WriteFileTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async WriteFileTool.run(ctx: ToolContext, args: dict) -> ToolResult