From da4f356fab81e3f3077f2e746464f6abb791fc84 Mon Sep 17 00:00:00 2001 From: Archkon <180910180+Archkon@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:18:45 +0800 Subject: [PATCH] fix:typo error (#1738) * Update base_agent_tools.py typo error * Update main.py typo error * Update base_file_knowledge_source.py typo error * Update test_main.py typo error * Update en.json * Update prompts.json --------- Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com> --- src/crewai/cli/tools/main.py | 4 ++-- src/crewai/knowledge/source/base_file_knowledge_source.py | 2 +- src/crewai/tools/agent_tools/base_agent_tools.py | 4 ++-- src/crewai/translations/en.json | 2 +- tests/cli/tools/test_main.py | 2 +- tests/utilities/prompts.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/crewai/cli/tools/main.py b/src/crewai/cli/tools/main.py index 35652a1ec..b2d2cec99 100644 --- a/src/crewai/cli/tools/main.py +++ b/src/crewai/cli/tools/main.py @@ -117,7 +117,7 @@ class ToolCommand(BaseCommand, PlusAPIMixin): published_handle = publish_response.json()["handle"] console.print( - f"Succesfully published {published_handle} ({project_version}).\nInstall it in other projects with crewai tool install {published_handle}", + f"Successfully published {published_handle} ({project_version}).\nInstall it in other projects with crewai tool install {published_handle}", style="bold green", ) @@ -138,7 +138,7 @@ class ToolCommand(BaseCommand, PlusAPIMixin): self._add_package(get_response.json()) - console.print(f"Succesfully installed {handle}", style="bold green") + console.print(f"Successfully installed {handle}", style="bold green") def login(self): login_response = self.plus_api_client.login_to_tool_repository() diff --git a/src/crewai/knowledge/source/base_file_knowledge_source.py b/src/crewai/knowledge/source/base_file_knowledge_source.py index 7f078b4a4..ae9b3bf71 100644 --- a/src/crewai/knowledge/source/base_file_knowledge_source.py +++ b/src/crewai/knowledge/source/base_file_knowledge_source.py @@ -38,7 +38,7 @@ class BaseFileKnowledgeSource(BaseKnowledgeSource, ABC): if not path.exists(): self._logger.log( "error", - f"File not found: {path}. Try adding sources to the knowledge directory. If its inside the knowledge directory, use the relative path.", + f"File not found: {path}. Try adding sources to the knowledge directory. If it's inside the knowledge directory, use the relative path.", color="red", ) raise FileNotFoundError(f"File not found: {path}") diff --git a/src/crewai/tools/agent_tools/base_agent_tools.py b/src/crewai/tools/agent_tools/base_agent_tools.py index bedb2aed6..4311be6a3 100644 --- a/src/crewai/tools/agent_tools/base_agent_tools.py +++ b/src/crewai/tools/agent_tools/base_agent_tools.py @@ -44,14 +44,14 @@ class BaseAgentTool(BaseTool): if available_agent.role.casefold().replace("\n", "") == agent_name ] except Exception as _: - return self.i18n.errors("agent_tool_unexsiting_coworker").format( + return self.i18n.errors("agent_tool_unexisting_coworker").format( coworkers="\n".join( [f"- {agent.role.casefold()}" for agent in self.agents] ) ) if not agent: - return self.i18n.errors("agent_tool_unexsiting_coworker").format( + return self.i18n.errors("agent_tool_unexisting_coworker").format( coworkers="\n".join( [f"- {agent.role.casefold()}" for agent in self.agents] ) diff --git a/src/crewai/translations/en.json b/src/crewai/translations/en.json index 7353cfc33..2b8fec44b 100644 --- a/src/crewai/translations/en.json +++ b/src/crewai/translations/en.json @@ -28,7 +28,7 @@ "errors": { "force_final_answer_error": "You can't keep going, this was the best you could do.\n {formatted_answer.text}", "force_final_answer": "Now it's time you MUST give your absolute best final answer. You'll ignore all previous instructions, stop using any tools, and just return your absolute BEST Final answer.", - "agent_tool_unexsiting_coworker": "\nError executing tool. coworker mentioned not found, it must be one of the following options:\n{coworkers}\n", + "agent_tool_unexisting_coworker": "\nError executing tool. coworker mentioned not found, it must be one of the following options:\n{coworkers}\n", "task_repeated_usage": "I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n\n", "tool_usage_error": "I encountered an error: {error}", "tool_arguments_error": "Error: the Action Input is not a valid key, value dictionary.", diff --git a/tests/cli/tools/test_main.py b/tests/cli/tools/test_main.py index 3804fb9b4..10c29b920 100644 --- a/tests/cli/tools/test_main.py +++ b/tests/cli/tools/test_main.py @@ -85,7 +85,7 @@ def test_install_success(mock_get, mock_subprocess_run): env=unittest.mock.ANY ) - assert "Succesfully installed sample-tool" in output + assert "Successfully installed sample-tool" in output @patch("crewai.cli.plus_api.PlusAPI.get_tool") diff --git a/tests/utilities/prompts.json b/tests/utilities/prompts.json index 55bbfae8f..a51203dbc 100644 --- a/tests/utilities/prompts.json +++ b/tests/utilities/prompts.json @@ -26,7 +26,7 @@ }, "errors": { "force_final_answer": "Lorem ipsum dolor sit amet", - "agent_tool_unexsiting_coworker": "Lorem ipsum dolor sit amet", + "agent_tool_unexisting_coworker": "Lorem ipsum dolor sit amet", "task_repeated_usage": "Lorem ipsum dolor sit amet", "tool_usage_error": "Lorem ipsum dolor sit amet", "tool_arguments_error": "Lorem ipsum dolor sit amet",