From 54f8d3674e79702f8ce6817c01080cef443cd273 Mon Sep 17 00:00:00 2001 From: Vinicius Brasil Date: Wed, 10 Sep 2025 09:31:18 -0300 Subject: [PATCH] Clarify tool support for both local and remote URLs 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. --- crewai_tools/tools/csv_search_tool/csv_search_tool.py | 4 ++-- crewai_tools/tools/docx_search_tool/docx_search_tool.py | 2 +- crewai_tools/tools/json_search_tool/json_search_tool.py | 7 ++++--- crewai_tools/tools/mdx_search_tool/mdx_search_tool.py | 4 ++-- crewai_tools/tools/pdf_search_tool/pdf_search_tool.py | 6 +++--- crewai_tools/tools/txt_search_tool/txt_search_tool.py | 2 +- crewai_tools/tools/xml_search_tool/xml_search_tool.py | 5 ++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crewai_tools/tools/csv_search_tool/csv_search_tool.py b/crewai_tools/tools/csv_search_tool/csv_search_tool.py index 4567df20..05572d8b 100644 --- a/crewai_tools/tools/csv_search_tool/csv_search_tool.py +++ b/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/crewai_tools/tools/docx_search_tool/docx_search_tool.py b/crewai_tools/tools/docx_search_tool/docx_search_tool.py index cdd76c29..a9d2c961 100644 --- a/crewai_tools/tools/docx_search_tool/docx_search_tool.py +++ b/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/crewai_tools/tools/json_search_tool/json_search_tool.py b/crewai_tools/tools/json_search_tool/json_search_tool.py index 5d832c6b..820323ee 100644 --- a/crewai_tools/tools/json_search_tool/json_search_tool.py +++ b/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/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py b/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py index dfab255b..14afe5db 100644 --- a/crewai_tools/tools/mdx_search_tool/mdx_search_tool.py +++ b/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/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py b/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py index d5621978..ad0b8f8d 100644 --- a/crewai_tools/tools/pdf_search_tool/pdf_search_tool.py +++ b/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/crewai_tools/tools/txt_search_tool/txt_search_tool.py b/crewai_tools/tools/txt_search_tool/txt_search_tool.py index ebbde122..93d696ab 100644 --- a/crewai_tools/tools/txt_search_tool/txt_search_tool.py +++ b/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/crewai_tools/tools/xml_search_tool/xml_search_tool.py b/crewai_tools/tools/xml_search_tool/xml_search_tool.py index 2e0d26a8..426b0ca3 100644 --- a/crewai_tools/tools/xml_search_tool/xml_search_tool.py +++ b/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):