-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update Dalle, FileWrite, Nl2Sql and Side menu Tools (#1175)
* docs: Update Dalle, FileWrite, Nl2Sql and Side menu Tools * docs: remove unused phrase * docs: fix identation
- Loading branch information
1 parent
9f85a2a
commit 97d7bfb
Showing
4 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# FileWriterTool Documentation | ||
|
||
## Description | ||
The `FileWriterTool` is a component of the crewai_tools package, designed to simplify the process of writing content to files. It is particularly useful in scenarios such as generating reports, saving logs, creating configuration files, and more. This tool supports creating new directories if they don't exist, making it easier to organize your output. | ||
|
||
## Installation | ||
Install the crewai_tools package to use the `FileWriterTool` in your projects: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
To get started with the `FileWriterTool`: | ||
|
||
```python | ||
from crewai_tools import FileWriterTool | ||
|
||
# Initialize the tool | ||
file_writer_tool = FileWriterTool() | ||
|
||
# Write content to a file in a specified directory | ||
result = file_writer_tool._run('example.txt', 'This is a test content.', 'test_directory') | ||
print(result) | ||
``` | ||
|
||
## Arguments | ||
- `filename`: The name of the file you want to create or overwrite. | ||
- `content`: The content to write into the file. | ||
- `directory` (optional): The path to the directory where the file will be created. Defaults to the current directory (`.`). If the directory does not exist, it will be created. | ||
|
||
## Conclusion | ||
By integrating the `FileWriterTool` into your crews, the agents can execute the process of writing content to files and creating directories. This tool is essential for tasks that require saving output data, creating structured file systems, and more. By adhering to the setup and usage guidelines provided, incorporating this tool into projects is straightforward and efficient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters