read#
Build typed tools from annotations and docstrings. See the guide.
Read a local file: UTF-8 text as a line range, or a PNG, JPEG, GIF, or WebP image as an image.
Parameters#
{
"additionalProperties": false,
"properties": {
"file_path": {
"minLength": 1,
"type": "string",
"description": "Absolute path or a path relative to the current working directory."
},
"offset": {
"minimum": 1,
"type": "integer",
"default": 1,
"description": "One-based line number to start reading from; ignored for images."
},
"limit": {
"maximum": 2000,
"minimum": 1,
"type": "integer",
"default": 2000,
"description": "Maximum number of lines to return, 2,000 by default and never more; the text is also held to 50 KB, which the trailing hint below is added to; ignored for images."
}
},
"required": [
"file_path"
],
"type": "object"
}
Model-facing snippet#
read(file_path="docs/diagram.png")
Guidelines#
Use for any local file when you do not know whether it is text or an image.
A text file comes back as a line range; use line ranges for large files.
A trailing hint says how to go on: the next offset when more lines remain, or the shell when one line is longer than the output limit.
An image comes back as an image with a one-line description; the range arguments do not apply to it.
The line numbers are for reference; do not copy them into an edit or a write.
PDF and SVG files are not supported.
- zett_agent.tools.files.read#
A tool is a name, an input schema, and an async callable.
- Parameters:
arguments (Mapping[str, Any])
- Return type:
Direct Python calls use await tool(arguments_mapping). The snippet
above describes model-facing invocation syntax, not the Python call signature.