Skip to content

Commit 2c2459e

Browse files
committed
refac
1 parent d5c9fc4 commit 2c2459e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

open_terminal/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ async def list_files(
418418
"/files/read",
419419
operation_id="read_file",
420420
summary="Read a file",
421-
description="Return the contents of a file. Text files return JSON with a content string. Supported binary types (configurable, default: image/*) return the raw binary with the appropriate Content-Type. Unsupported binary types are rejected. Optionally specify a line range for text files. This returns file content to you but does not show anything to the user. Use display_file to let the user see a file.",
421+
description="Read a file and return its contents. Supports text files and images (PNG, JPEG, WebP, etc.). For text files you can optionally request a specific line range. Images are returned as binary so you can view and analyze them directly. Use display_file to show a file to the user.",
422422
dependencies=[Depends(verify_api_key)],
423423
responses={
424424
404: {"description": "File not found."},
@@ -429,13 +429,14 @@ async def list_files(
429429
async def read_file(
430430
path: str = Query(..., description="Path to the file to read."),
431431
start_line: Optional[int] = Query(
432-
None, description="First line to return (1-indexed, inclusive).", ge=1
432+
None, description="First line to return (1-indexed, inclusive). Omit to start from the beginning.", ge=1
433433
),
434434
end_line: Optional[int] = Query(
435-
None, description="Last line to return (1-indexed, inclusive).", ge=1
435+
None, description="Last line to return (1-indexed, inclusive). Omit to read to the end.", ge=1
436436
),
437437
fs: UserFS = Depends(get_filesystem),
438438
):
439+
439440
target = fs.resolve_path(path)
440441
if not await fs.isfile(target):
441442
raise HTTPException(status_code=404, detail="File not found")

0 commit comments

Comments
 (0)