Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
Fix small typo in sample tool (#1747)
André Lago8094754239f1
diff --git a/src/crewai/cli/templates/crew/tools/custom_tool.py b/src/crewai/cli/templates/crew/tools/custom_tool.pyindex 50bffa505..154beae8e 100644--- a/src/crewai/cli/templates/crew/tools/custom_tool.py+++ b/src/crewai/cli/templates/crew/tools/custom_tool.py@@ -10,7 +10,7 @@ class MyCustomToolInput(BaseModel):class MyCustomTool(BaseTool):name: str = "Name of my tool"description: str = (- "Clear description for what this tool is useful for, you agent will need this information to use it."+ "Clear description for what this tool is useful for, your agent will need this information to use it.")args_schema: Type[BaseModel] = MyCustomToolInputdiff --git a/src/crewai/cli/templates/flow/tools/custom_tool.py b/src/crewai/cli/templates/flow/tools/custom_tool.pyindex e669b6c3b..718d2be1b 100644--- a/src/crewai/cli/templates/flow/tools/custom_tool.py+++ b/src/crewai/cli/templates/flow/tools/custom_tool.py@@ -13,7 +13,7 @@ class MyCustomToolInput(BaseModel):class MyCustomTool(BaseTool):name: str = "Name of my tool"description: str = (- "Clear description for what this tool is useful for, you agent will need this information to use it."+ "Clear description for what this tool is useful for, your agent will need this information to use it.")args_schema: Type[BaseModel] = MyCustomToolInputdiff --git a/tests/tools/test_base_tool.py b/tests/tools/test_base_tool.pyindex cd4b53caf..9f46b13ba 100644--- a/tests/tools/test_base_tool.py+++ b/tests/tools/test_base_tool.py@@ -6,14 +6,14 @@ from crewai.tools import BaseTool, tooldef test_creating_a_tool_using_annotation():@tool("Name of my tool")def my_tool(question: str) -> str:- """Clear description for what this tool is useful for, you agent will need this information to use it."""+ """Clear description for what this tool is useful for, your agent will need this information to use it."""return question# Assert all the right attributes were definedassert my_tool.name == "Name of my tool"assert (my_tool.description- == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."+ == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, your agent will need this information to use it.")assert my_tool.args_schema.schema()["properties"] == {"question": {"title": "Question", "type": "string"}@@ -27,7 +27,7 @@ def test_creating_a_tool_using_annotation():assert (converted_tool.description- == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."+ == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, your agent will need this information to use it.")assert converted_tool.args_schema.schema()["properties"] == {"question": {"title": "Question", "type": "string"}@@ -41,7 +41,7 @@ def test_creating_a_tool_using_annotation():def test_creating_a_tool_using_baseclass():class MyCustomTool(BaseTool):name: str = "Name of my tool"- description: str = "Clear description for what this tool is useful for, you agent will need this information to use it."+ description: str = "Clear description for what this tool is useful for, your agent will need this information to use it."def _run(self, question: str) -> str:return question@@ -52,7 +52,7 @@ def test_creating_a_tool_using_baseclass():assert (my_tool.description- == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."+ == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, your agent will need this information to use it.")assert my_tool.args_schema.schema()["properties"] == {"question": {"title": "Question", "type": "string"}@@ -64,7 +64,7 @@ def test_creating_a_tool_using_baseclass():assert (converted_tool.description- == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."+ == "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, your agent will need this information to use it.")assert converted_tool.args_schema.schema()["properties"] == {"question": {"title": "Question", "type": "string"}@@ -78,7 +78,7 @@ def test_creating_a_tool_using_baseclass():def test_setting_cache_function():class MyCustomTool(BaseTool):name: str = "Name of my tool"- description: str = "Clear description for what this tool is useful for, you agent will need this information to use it."+ description: str = "Clear description for what this tool is useful for, your agent will need this information to use it."cache_function: Callable = lambda: Falsedef _run(self, question: str) -> str:@@ -92,7 +92,7 @@ def test_setting_cache_function():def test_default_cache_function_is_true():class MyCustomTool(BaseTool):name: str = "Name of my tool"- description: str = "Clear description for what this tool is useful for, you agent will need this information to use it."+ description: str = "Clear description for what this tool is useful for, your agent will need this information to use it."def _run(self, question: str) -> str:return question