From 97d7bfb52ad49a9f04db360e1b6612d98c91971e Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Tue, 13 Aug 2024 12:29:34 -0300 Subject: [PATCH] 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 --- docs/tools/DALL-ETool.md | 10 +++++----- docs/tools/FileWriteTool.md | 33 +++++++++++++++++++++++++++++++ docs/tools/NL2SQLTool.md | 12 ++++++------ mkdocs.yml | 39 +++++++++++++++++++------------------ 4 files changed, 64 insertions(+), 30 deletions(-) create mode 100644 docs/tools/FileWriteTool.md diff --git a/docs/tools/DALL-ETool.md b/docs/tools/DALL-ETool.md index a315c7c10..8f65e78e5 100644 --- a/docs/tools/DALL-ETool.md +++ b/docs/tools/DALL-ETool.md @@ -27,10 +27,10 @@ If needed you can also tweak the parameters of the DALL-E model by passing them ```python from crewai_tools import DallETool -dalle_tool = DallETool(model: str = "dall-e-3", - size: str = "1024x1024", - quality: str = "standard", - n: int = 1) +dalle_tool = DallETool(model="dall-e-3", + size="1024x1024", + quality="standard", + n=1) Agent( ... @@ -38,4 +38,4 @@ Agent( ) ``` -The parameter are based on the `client.images.generate` method from the OpenAI API. For more information on the parameters, please refer to the [OpenAI API documentation](https://platform.openai.com/docs/guides/images/introduction?lang=python). +The parameters are based on the `client.images.generate` method from the OpenAI API. For more information on the parameters, please refer to the [OpenAI API documentation](https://platform.openai.com/docs/guides/images/introduction?lang=python). diff --git a/docs/tools/FileWriteTool.md b/docs/tools/FileWriteTool.md new file mode 100644 index 000000000..3425af003 --- /dev/null +++ b/docs/tools/FileWriteTool.md @@ -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. diff --git a/docs/tools/NL2SQLTool.md b/docs/tools/NL2SQLTool.md index d0bb82271..c442d1f96 100644 --- a/docs/tools/NL2SQLTool.md +++ b/docs/tools/NL2SQLTool.md @@ -47,8 +47,8 @@ The primary task goal was: So the Agent tried to get information from the DB, the first one is wrong so the Agent tries again and gets the correct information and passes to the next agent. -![alt text](images/image-2.png) -![alt text](images/image-3.png) +![alt text](https://github.com/crewAIInc/crewAI-tools/blob/main/crewai_tools/tools/nl2sql/images/image-2.png?raw=true) +![alt text](https://github.com/crewAIInc/crewAI-tools/raw/main/crewai_tools/tools/nl2sql/images/image-3.png) The second task goal was: @@ -58,11 +58,11 @@ Include information on the average, maximum, and minimum monthly revenue for eac Now things start to get interesting, the Agent generates the SQL query to not only create the table but also insert the data into the table. And in the end the Agent still returns the final report which is exactly what was in the database. -![alt text](images/image-4.png) -![alt text](images/image-5.png) +![alt text](https://github.com/crewAIInc/crewAI-tools/raw/main/crewai_tools/tools/nl2sql/images/image-4.png) +![alt text](https://github.com/crewAIInc/crewAI-tools/raw/main/crewai_tools/tools/nl2sql/images/image-5.png) -![alt text](images/image-9.png) -![alt text](images/image-7.png) +![alt text](https://github.com/crewAIInc/crewAI-tools/raw/main/crewai_tools/tools/nl2sql/images/image-9.png) +![alt text](https://github.com/crewAIInc/crewAI-tools/raw/main/crewai_tools/tools/nl2sql/images/image-7.png) This is a simple example of how the NL2SQLTool can be used to interact with the database and generate reports based on the data in the database. diff --git a/mkdocs.yml b/mkdocs.yml index 02ee3c1ab..8ce7aab27 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -152,36 +152,37 @@ nav: - Agent Monitoring with AgentOps: 'how-to/AgentOps-Observability.md' - Agent Monitoring with LangTrace: 'how-to/Langtrace-Observability.md' - Tools Docs: - - Firecrawl Scrape Website Tool: 'tools/FirecrawlScrapeWebsiteTool.md' - - Firecrawl Crawl Website Tool: 'tools/FirecrawlCrawlWebsiteTool.md' - - Firecrawl Search Tool: 'tools/FirecrawlSearchTool.md' - - Google Serper Search: 'tools/SerperDevTool.md' - Browserbase Web Loader: 'tools/BrowserbaseLoadTool.md' - - Composio Tools: 'tools/ComposioTool.md' + - Code Docs RAG Search: 'tools/CodeDocsSearchTool.md' - Code Interpreter: 'tools/CodeInterpreterTool.md' - - Scrape Website: 'tools/ScrapeWebsiteTool.md' - - Directory Read: 'tools/DirectoryReadTool.md' - - Exa Serch Web Loader: 'tools/EXASearchTool.md' - - File Read: 'tools/FileReadTool.md' - - Selenium Scraper: 'tools/SeleniumScrapingTool.md' - - Directory RAG Search: 'tools/DirectorySearchTool.md' - - DALL-E Tool: 'tools/DALL-ETool.md' - - PDF RAG Search: 'tools/PDFSearchTool.md' - - TXT RAG Search: 'tools/TXTSearchTool.md' + - Composio Tools: 'tools/ComposioTool.md' - CSV RAG Search: 'tools/CSVSearchTool.md' - - XML RAG Search: 'tools/XMLSearchTool.md' - - JSON RAG Search: 'tools/JSONSearchTool.md' + - DALL-E Tool: 'tools/DALL-ETool.md' + - Directory RAG Search: 'tools/DirectorySearchTool.md' + - Directory Read: 'tools/DirectoryReadTool.md' - Docx Rag Search: 'tools/DOCXSearchTool.md' + - EXA Serch Web Loader: 'tools/EXASearchTool.md' + - File Read: 'tools/FileReadTool.md' + - File Write: 'tools/FileWriteTool.md' + - Firecrawl Crawl Website Tool: 'tools/FirecrawlCrawlWebsiteTool.md' + - Firecrawl Scrape Website Tool: 'tools/FirecrawlScrapeWebsiteTool.md' + - Firecrawl Search Tool: 'tools/FirecrgstawlSearchTool.md' + - Github RAG Search: 'tools/GitHubSearchTool.md' + - Google Serper Search: 'tools/SerperDevTool.md' + - JSON RAG Search: 'tools/JSONSearchTool.md' - MDX RAG Search: 'tools/MDXSearchTool.md' - MySQL Tool: 'tools/MySQLTool.md' - NL2SQL Tool: 'tools/NL2SQLTool.md' + - PDF RAG Search: 'tools/PDFSearchTool.md' - PG RAG Search: 'tools/PGSearchTool.md' + - Scrape Website: 'tools/ScrapeWebsiteTool.md' + - Selenium Scraper: 'tools/SeleniumScrapingTool.md' + - TXT RAG Search: 'tools/TXTSearchTool.md' - Vision Tool: 'tools/VisionTool.md' - Website RAG Search: 'tools/WebsiteSearchTool.md' - - Github RAG Search: 'tools/GitHubSearchTool.md' - - Code Docs RAG Search: 'tools/CodeDocsSearchTool.md' - - Youtube Video RAG Search: 'tools/YoutubeVideoSearchTool.md' + - XML RAG Search: 'tools/XMLSearchTool.md' - Youtube Channel RAG Search: 'tools/YoutubeChannelSearchTool.md' + - Youtube Video RAG Search: 'tools/YoutubeVideoSearchTool.md' - Examples: - Trip Planner Crew: https://github.com/joaomdmoura/crewAI-examples/tree/main/trip_planner" - Create Instagram Post: https://github.com/joaomdmoura/crewAI-examples/tree/main/instagram_post"