Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
File tool allows you to read, write, and manage files from your AI agents.
Installation
pip install "praisonai[tools]"
Quick Start
from praisonai_tools import FileTool
# Initialize
file = FileTool()
# Read file
content = file.read("document.txt")
print(content)
Usage with Agent
from praisonaiagents import Agent
from praisonai_tools import FileTool
agent = Agent(
name="FileManager",
instructions="You help manage files.",
tools=[FileTool()]
)
response = agent.chat("Read the contents of config.json")
print(response)
Available Methods
read(path)
Read file contents.
from praisonai_tools import FileTool
file = FileTool()
content = file.read("data.txt")
write(path, content)
Write content to a file.
file.write("output.txt", "Hello World!")
list_dir(path)
List directory contents.
files = file.list_dir("./documents")
Common Errors
| Error | Cause | Solution |
|---|
File not found | Invalid path | Check file path |
Permission denied | No access | Check permissions |