From 6f2301c945bb7f856a6913606fd01b65e256d62d Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Wed, 10 Sep 2025 09:38:14 -0300 Subject: [PATCH] Clarify tool support for both local and remote URLs (#447) This commit updates tool prompts to explicitly highlight that some tools can accept both local file paths and remote URLs. The improved prompts ensure LLMs understand they may pass remote resources. --- src/crewai_tools/tools/csv_search_tool/csv_search_tool.py | 4 ++-- .../tools/docx_search_tool/docx_search_tool.py | 2 +- .../tools/json_search_tool/json_search_tool.py | 7 ++++--- src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py | 4 ++-- src/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py | 6 +++--- src/crewai_tools/tools/txt_search_tool/txt_search_tool.py | 2 +- src/crewai_tools/tools/xml_search_tool/xml_search_tool.py | 5 ++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py b/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py index 4567df201..05572d8bb 100644 --- a/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py +++ b/src/crewai_tools/tools/csv_search_tool/csv_search_tool.py @@ -1,4 +1,4 @@ -from typing import Any, Optional, Type +from typing import Optional, Type from embedchain.models.data_type import DataType from pydantic import BaseModel, Field @@ -18,7 +18,7 @@ class FixedCSVSearchToolSchema(BaseModel): class CSVSearchToolSchema(FixedCSVSearchToolSchema): """Input for CSVSearchTool.""" - csv: str = Field(..., description="Mandatory csv path you want to search") + csv: str = Field(..., description="File path or URL of a CSV file to be searched") class CSVSearchTool(RagTool): diff --git a/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py b/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py index cdd76c29d..a9d2c9610 100644 --- a/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py +++ b/src/crewai_tools/tools/docx_search_tool/docx_search_tool.py @@ -10,7 +10,7 @@ class FixedDOCXSearchToolSchema(BaseModel): """Input for DOCXSearchTool.""" docx: Optional[str] = Field( - ..., description="Mandatory docx path you want to search" + ..., description="File path or URL of a DOCX file to be searched" ) search_query: str = Field( ..., diff --git a/src/crewai_tools/tools/json_search_tool/json_search_tool.py b/src/crewai_tools/tools/json_search_tool/json_search_tool.py index 5d832c6b9..820323eec 100644 --- a/src/crewai_tools/tools/json_search_tool/json_search_tool.py +++ b/src/crewai_tools/tools/json_search_tool/json_search_tool.py @@ -1,6 +1,5 @@ -from typing import Any, Optional, Type +from typing import Optional, Type -from embedchain.models.data_type import DataType from pydantic import BaseModel, Field from ..rag.rag_tool import RagTool @@ -18,7 +17,9 @@ class FixedJSONSearchToolSchema(BaseModel): class JSONSearchToolSchema(FixedJSONSearchToolSchema): """Input for JSONSearchTool.""" - json_path: str = Field(..., description="Mandatory json path you want to search") + json_path: str = Field( + ..., description="File path or URL of a JSON file to be searched" + ) class JSONSearchTool(RagTool): diff --git a/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py b/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py index dfab255b0..14afe5db7 100644 --- a/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py +++ b/src/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py @@ -1,4 +1,4 @@ -from typing import Any, Optional, Type +from typing import Optional, Type from embedchain.models.data_type import DataType from pydantic import BaseModel, Field @@ -18,7 +18,7 @@ class FixedMDXSearchToolSchema(BaseModel): class MDXSearchToolSchema(FixedMDXSearchToolSchema): """Input for MDXSearchTool.""" - mdx: str = Field(..., description="Mandatory mdx path you want to search") + mdx: str = Field(..., description="File path or URL of a MDX file to be searched") class MDXSearchTool(RagTool): diff --git a/src/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py b/src/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py index d56219785..ad0b8f8d3 100644 --- a/src/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py +++ b/src/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py @@ -1,7 +1,7 @@ -from typing import Any, Optional, Type +from typing import Optional, Type from embedchain.models.data_type import DataType -from pydantic import BaseModel, Field, model_validator +from pydantic import BaseModel, Field from ..rag.rag_tool import RagTool @@ -17,7 +17,7 @@ class FixedPDFSearchToolSchema(BaseModel): class PDFSearchToolSchema(FixedPDFSearchToolSchema): """Input for PDFSearchTool.""" - pdf: str = Field(..., description="Mandatory pdf path you want to search") + pdf: str = Field(..., description="File path or URL of a PDF file to be searched") class PDFSearchTool(RagTool): diff --git a/src/crewai_tools/tools/txt_search_tool/txt_search_tool.py b/src/crewai_tools/tools/txt_search_tool/txt_search_tool.py index ebbde1223..93d696ab1 100644 --- a/src/crewai_tools/tools/txt_search_tool/txt_search_tool.py +++ b/src/crewai_tools/tools/txt_search_tool/txt_search_tool.py @@ -17,7 +17,7 @@ class FixedTXTSearchToolSchema(BaseModel): class TXTSearchToolSchema(FixedTXTSearchToolSchema): """Input for TXTSearchTool.""" - txt: str = Field(..., description="Mandatory txt path you want to search") + txt: str = Field(..., description="File path or URL of a TXT file to be searched") class TXTSearchTool(RagTool): diff --git a/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py b/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py index 2e0d26a88..426b0ca38 100644 --- a/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py +++ b/src/crewai_tools/tools/xml_search_tool/xml_search_tool.py @@ -1,6 +1,5 @@ -from typing import Any, Optional, Type +from typing import Optional, Type -from embedchain.models.data_type import DataType from pydantic import BaseModel, Field from ..rag.rag_tool import RagTool @@ -18,7 +17,7 @@ class FixedXMLSearchToolSchema(BaseModel): class XMLSearchToolSchema(FixedXMLSearchToolSchema): """Input for XMLSearchTool.""" - xml: str = Field(..., description="Mandatory xml path you want to search") + xml: str = Field(..., description="File path or URL of a XML file to be searched") class XMLSearchTool(RagTool):