read_file/edit_file:新增32MB全文读取上限防OOM(超限引导terminal);空文件/end<start显式反馈;CRLF显示剥\r;read_file描述补齐阈值/vision/大小契约
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read_file",
|
||||
"description": "Reads the content of a file.\n\n- For large text files, this tool may return an outline with symbol names and line numbers instead of the full content. This outline IS a successful response; use the line numbers to read specific sections with `start_line` and `end_line`.\n- Do NOT retry reading the same file without line numbers if you receive an outline.\n- Supports reading image files (PNG, JPEG, WebP, GIF, BMP, TIFF) and returns them as visual content you can analyze directly.\n- When reading text files, each line in the returned content is prefixed with a right-aligned line number field and a tab. When extracting text for use in `edit_file`, remove this prefix and keep only the content after the tab, preserving original indentation.",
|
||||
"description": "Reads the content of a file.\n\nText files: each returned line is prefixed with a line number right-aligned in a 6-character field, followed by a tab, then the line content.\n\nLarge text files (roughly over 16 KB) are not returned in full: you get an outline listing top-level symbols (or Markdown headings) with line numbers instead. The outline IS a successful response — do NOT retry the same call without a line range; use the outline line numbers with `start_line` / `end_line` to read specific sections. If no outline can be extracted, a first-1KB excerpt is returned instead. Supplying `start_line` or `end_line` disables outline mode.\n\nImage files (PNG, JPEG, WebP, GIF, BMP, TIFF) are returned as visual content you can analyze directly, but only if the current model supports vision; otherwise a text placeholder is returned — that placeholder is not an error. Very large images (roughly over 50 MB) are skipped, and images may be downscaled (long edge ~2000 px, re-encoded as JPEG) before being returned.\n\nBinary files are not returned as text; a short notice is returned instead. Text files over 32 MB cannot be read by this tool — use `terminal` (grep -n / head / sed -n).",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"required": ["path"],
|
||||
@@ -84,14 +84,14 @@
|
||||
"start_line": {
|
||||
"type": "integer",
|
||||
"nullable": true,
|
||||
"description": "Optional line number to start reading from (1-based).",
|
||||
"description": "Optional 1-based line number to start reading from.",
|
||||
"default": null,
|
||||
"minimum": 1
|
||||
},
|
||||
"end_line": {
|
||||
"type": "integer",
|
||||
"nullable": true,
|
||||
"description": "Optional line number to end reading at (1-based, inclusive).",
|
||||
"description": "Optional 1-based line number to end reading at (inclusive). Must be >= start_line. Supplying either bound disables outline mode.",
|
||||
"default": null,
|
||||
"minimum": 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user