File tree Expand file tree Collapse file tree
agentstack/_tools/file_read Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 "category" : " computer-control" ,
44 "tools" : [" read_file" ],
55 "description" : " Read contents of files" ,
6- "url" : " https://github.com/AgentOps-AI/AgentStack/tree/main/ agentstack/tools/file_read" ,
6+ "url" : " https://docs. agentstack.sh /tools/tool /file_read" ,
77 "dependencies" : []
88}
Original file line number Diff line number Diff line change @@ -3,8 +3,38 @@ title: 'File Read'
33description : ' Enables agents to read files stored locally'
44---
55
6+ # File Read
7+
8+ This tool allows agents to read files stored locally on the system.
9+
610## Installation
711
12+ To install the File Read tool, run the following command:
13+
814``` bash
915agentstack tools add file_read
10- ```
16+ ```
17+
18+ ## Functions
19+
20+ ### ` file_read.read_file(file_path: str) -> str `
21+
22+ Reads the contents of a file at the given path.
23+
24+ #### Parameters:
25+ - ` file_path ` (str): Path to the file to read
26+
27+ #### Returns:
28+ - ` str ` : The contents of the file as a string
29+
30+ #### Raises:
31+ - ` FileNotFoundError ` : If the file does not exist
32+ - ` PermissionError ` : If the file cannot be accessed
33+ - ` Exception ` : For other file reading errors
34+
35+
36+ ## Notes
37+
38+ - The agent has access to the local file system.
39+ - Ensure that the agent has the necessary permissions to read the file.
40+ - Large files may consume significant memory when read entirely into a string.
You can’t perform that action at this time.
0 commit comments