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": {
"path": {
"minLength": 1,
"type": "string",
"description": "Absolute path or a path relative to the current working directory."
},
"start_line": {
"minimum": 1,
"type": "integer",
"default": 1,
"description": "One-based first line to return; ignored for images."
},
"line_count": {
"maximum": 2000,
"minimum": 1,
"type": "integer",
"default": 200,
"description": "Maximum number of lines to return; ignored for images."
},
"start_column": {
"minimum": 1,
"type": "integer",
"default": 1,
"description": "One-based character column on start_line, used to resume a long line; ignored for images."
}
},
"required": [
"path"
],
"title": "ToolInput",
"type": "object"
}
Model-facing snippet#
read(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 gives the next start_line and start_column when more text remains.
An image comes back as an image with a one-line description; the range arguments do not apply to it.
Use view_image for HTTP(S) image URLs. PDF and SVG files are not supported.
- zett_agent.tools.coding.read#
A tool is a name, an input schema, and an async callable.
- 参数:
arguments (Mapping[str, Any])
- 返回类型:
Direct Python calls use await tool(arguments_mapping). The snippet
above describes model-facing invocation syntax, not the Python call signature.