docs: clarify FileReadTool usage example

Show both runtime path and default-path construction, including a run() call that omits file_path.

Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-12 01:14:14 +00:00
parent 4a651677a2
commit fe66a567f0

View File

@@ -31,13 +31,13 @@ pip install 'crewai[tools]'
```python Code
from crewai_tools import FileReadTool
# Let the agent choose the file path at runtime
# Agent must pass file_path at runtime
file_read_tool = FileReadTool()
content = file_read_tool.run(file_path='path/to/your/file.txt')
# OR
# Set a default file path when you create the tool
# OR set a default file at construction
file_read_tool = FileReadTool(file_path='path/to/your/file.txt')
content = file_read_tool.run() # reads the default file
# Read only lines 100-149
partial_content = file_read_tool.run(