You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: open_terminal/main.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -418,7 +418,7 @@ async def list_files(
418
418
"/files/read",
419
419
operation_id="read_file",
420
420
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.",
422
422
dependencies=[Depends(verify_api_key)],
423
423
responses={
424
424
404: {"description": "File not found."},
@@ -429,13 +429,14 @@ async def list_files(
429
429
asyncdefread_file(
430
430
path: str=Query(..., description="Path to the file to read."),
431
431
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
433
433
),
434
434
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
436
436
),
437
437
fs: UserFS=Depends(get_filesystem),
438
438
):
439
+
439
440
target=fs.resolve_path(path)
440
441
ifnotawaitfs.isfile(target):
441
442
raiseHTTPException(status_code=404, detail="File not found")
0 commit comments