From d0f7b7ca0cb709b42602bb47f7918132041a668c Mon Sep 17 00:00:00 2001 From: Travis Dent Date: Wed, 5 Feb 2025 11:47:16 -0800 Subject: [PATCH] Fix URl to file_read tool and extend docs. Addresses #267 --- agentstack/_tools/file_read/config.json | 2 +- docs/tools/tool/file_read.mdx | 32 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/agentstack/_tools/file_read/config.json b/agentstack/_tools/file_read/config.json index 1d3118ac..7454927e 100644 --- a/agentstack/_tools/file_read/config.json +++ b/agentstack/_tools/file_read/config.json @@ -3,6 +3,6 @@ "category": "computer-control", "tools": ["read_file"], "description": "Read contents of files", - "url": "https://github.com/AgentOps-AI/AgentStack/tree/main/agentstack/tools/file_read", + "url": "https://docs.agentstack.sh/tools/tool/file_read", "dependencies": [] } diff --git a/docs/tools/tool/file_read.mdx b/docs/tools/tool/file_read.mdx index f8dc27dd..b057ddc3 100644 --- a/docs/tools/tool/file_read.mdx +++ b/docs/tools/tool/file_read.mdx @@ -3,8 +3,38 @@ title: 'File Read' description: 'Enables agents to read files stored locally' --- +# File Read + +This tool allows agents to read files stored locally on the system. + ## Installation +To install the File Read tool, run the following command: + ```bash agentstack tools add file_read -``` \ No newline at end of file +``` + +## Functions + +### `file_read.read_file(file_path: str) -> str` + +Reads the contents of a file at the given path. + +#### Parameters: +- `file_path` (str): Path to the file to read + +#### Returns: +- `str`: The contents of the file as a string + +#### Raises: +- `FileNotFoundError`: If the file does not exist +- `PermissionError`: If the file cannot be accessed +- `Exception`: For other file reading errors + + +## Notes + +- The agent has access to the local file system. +- Ensure that the agent has the necessary permissions to read the file. +- Large files may consume significant memory when read entirely into a string.